{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e593215f-9747-4b28-87d8-b44c19d197eb",
   "metadata": {},
   "source": [
    "# 环境说明"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1275fe3b-0878-432f-8e47-5f753b2b8308",
   "metadata": {},
   "source": [
    "conda版本：https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.11-Windows-x86_64.exe\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "35520baf-e417-45ab-bd67-2f572784e75b",
   "metadata": {},
   "source": [
    "python核心包：\n",
    "- bs4 == 0.0.1\n",
    "- pandas == 1.3.4"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0593f6f8-0be3-4ed5-ae11-4201ffb7b170",
   "metadata": {},
   "source": [
    "# 资产负债表爬虫解析"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3cbe2415-caf7-47ff-950e-44ddacd4f234",
   "metadata": {},
   "source": [
    "## bs4解析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "87d940e7-d704-48a9-b25c-89c397070fdf",
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp_zcfz_url = 'https://data.eastmoney.com/bbsj/201806/zcfz.html'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "84264230-5a2f-4e85-98f8-8cc62dff6813",
   "metadata": {},
   "source": [
    "### 获取内容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "b0f9eabf-d1d4-40ae-8f6f-375a4fc2d6ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "82ea5730-4910-4b1c-8191-7e62507b5ce6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# bs4解析\n",
    "page_content = requests.get(tmp_zcfz_url).text"
   ]
  },
  {
   "cell_type": "raw",
   "id": "eeb87671-958f-400a-9c9a-d7a8699c9224",
   "metadata": {
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "source": [
    "page_content"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "139714a8-ec1f-49b5-98fc-63d3865e8a00",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "188630"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(page_content)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "172c0c58-cda7-403e-9dc7-38fda9ea8171",
   "metadata": {},
   "source": [
    "### 携带请求头"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cbd1d28d-7ab8-4c63-af29-877dcad4b967",
   "metadata": {},
   "source": [
    "F12查看zcfz.html"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d1dcd715-8e47-4c3e-8367-7d297675829e",
   "metadata": {},
   "source": [
    "https://www.runoob.com/python3/python-requests.html"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8433ee6d-c3f3-4af2-bd64-e1447ffce7d6",
   "metadata": {},
   "source": [
    "### bs4导入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "4bad340a-e8a2-489b-bfd6-03643044f7e5",
   "metadata": {},
   "outputs": [],
   "source": [
    "from bs4 import BeautifulSoup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "dd937f47-f217-486f-b624-5c34985d6762",
   "metadata": {},
   "outputs": [],
   "source": [
    "soup = BeautifulSoup(page_content)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "8ec37b31-31d9-4d5f-b9ce-2ad036fdaa11",
   "metadata": {
    "tags": []
   },
   "source": [
    "soup"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6f1d85c7-6005-4fe7-85b3-7b85d721b99b",
   "metadata": {},
   "source": [
    "### F12观察布局"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "94a3a816-38bf-437e-b5f4-558365fc5aad",
   "metadata": {},
   "source": [
    "### CSS选择器"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9aea857b-b3d0-4b22-9753-c9916a95d67d",
   "metadata": {},
   "source": [
    "CSS选择器：https://www.runoob.com/cssref/css-selectors.html"
   ]
  },
  {
   "cell_type": "raw",
   "id": "681b9fdb-3d8d-4c7f-9729-3ebd1aee0eca",
   "metadata": {
    "tags": []
   },
   "source": [
    "soup.select('.mainnav-type')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2bd1fac0-3420-4524-bcdc-895d2915b57d",
   "metadata": {},
   "source": [
    "连选"
   ]
  },
  {
   "cell_type": "raw",
   "id": "e144b4ef-56dd-4fa1-adde-45b8a2247b8d",
   "metadata": {
    "tags": []
   },
   "source": [
    "soup.select('.mainnav-type ul')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a5e51398-8f60-4e9e-abf9-324a9576c00d",
   "metadata": {},
   "source": [
    "### 子项再选"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "aeb28f99-56c6-4e88-8d93-26eccc45b4fd",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "ul_list = soup.select('.mainnav-type ul')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "6a0c0a34-61a6-4dc0-b4b9-5ee63394a461",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(ul_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "1b6bc2e4-ed5e-4367-a2db-f6e468949372",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(ul_list[0].select('li'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "22787d7a-d07a-4f2e-9567-0abafce6a538",
   "metadata": {},
   "outputs": [],
   "source": [
    "len(ul_list[0].select('li'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "e73fbf57-f99d-4bb0-beae-026944d45a1f",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<li><a href=\"http://data.eastmoney.com/center/\">特色</a><a href=\"http://data.eastmoney.com/stock/lhb.html\">龙虎榜单</a><a href=\"http://data.eastmoney.com/rzrq/\">融资融券</a><a href=\"http://data.eastmoney.com/gpzy/\">股权质押</a><a href=\"http://data.eastmoney.com/dzjy/default.html\">大宗交易</a><a href=\"http://data.eastmoney.com/jgdy/\">机构调研</a><a href=\"http://data.eastmoney.com/IF/Data/Contract.html?va=IF\">期指持仓</a><a href=\"http://data.eastmoney.com/notices/\">公告大全</a><a href=\"http://data.eastmoney.com/xuangu/\">选股器</a></li>,\n",
       " <li><a href=\"http://data.eastmoney.com/bbsj/\">财报</a><a href=\"http://data.eastmoney.com/bbsj/\">业绩报表</a><a href=\"http://data.eastmoney.com/bbsj/yjyg.html\">最新预告</a><a href=\"http://data.eastmoney.com/yjfp/\">分红送配</a></li>,\n",
       " <li><a href=\"http://data.eastmoney.com/report/\">研报</a><a href=\"http://data.eastmoney.com/report/stock.jshtml\">个股研报</a><a href=\"http://data.eastmoney.com/report/industry.jshtml\">行业研报</a><a href=\"http://data.eastmoney.com/report/profitforecast.jshtml\">盈利预测</a></li>,\n",
       " <li><a href=\"http://data.eastmoney.com/xg/\">新股</a><a href=\"http://data.eastmoney.com/xg/xg/default.html\">新股申购</a><a href=\"http://data.eastmoney.com/xg/xg/calendar.html\">新股日历</a><a href=\"http://data.eastmoney.com/xg/gh/default.html\">新股上会</a></li>,\n",
       " <li><a href=\"http://data.eastmoney.com/zjlx/\">资金</a><a href=\"http://data.eastmoney.com/zjlx/dpzjlx.html\">大盘资金</a><a href=\"http://data.eastmoney.com/zjlx/detail.html\">个股资金</a><a href=\"http://data.eastmoney.com/bkzj/\">板块资金</a><a href=\"http://data.eastmoney.com/hsgt/\">沪港通</a></li>,\n",
       " <li><a href=\"http://fund.eastmoney.com/data/\">基金</a><a href=\"http://fund.eastmoney.com/fund.html\">基金净值</a><a href=\"http://fund.eastmoney.com/fundguzhi.html\">基金估值</a><a href=\"http://fund.eastmoney.com/data/fundranking.html\">基金排行</a></li>,\n",
       " <li><a href=\"http://data.eastmoney.com/cjsj/cpi.html\">经济</a><a href=\"http://data.eastmoney.com/cjsj/cpi.html\">CPI</a><a href=\"http://data.eastmoney.com/cjsj/ppi.html\">PPI</a><a href=\"http://data.eastmoney.com/cjsj/pmi.html\">PMI</a><a href=\"http://data.eastmoney.com/cjsj/gdp.html\">GDP</a><a href=\"http://data.eastmoney.com/cjsj/yhll.html\">利率</a><a href=\"http://data.eastmoney.com/cjsj/newhouse.html\">房价</a></li>]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ul_list[0].select('li')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9d124d73-8aef-45c4-84c2-1f7b6192bf2f",
   "metadata": {},
   "source": [
    "### 子项数据获取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "cedd0834-43e3-4787-af40-aef7964966c1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<li><a href=\"http://data.eastmoney.com/center/\">特色</a><a href=\"http://data.eastmoney.com/stock/lhb.html\">龙虎榜单</a><a href=\"http://data.eastmoney.com/rzrq/\">融资融券</a><a href=\"http://data.eastmoney.com/gpzy/\">股权质押</a><a href=\"http://data.eastmoney.com/dzjy/default.html\">大宗交易</a><a href=\"http://data.eastmoney.com/jgdy/\">机构调研</a><a href=\"http://data.eastmoney.com/IF/Data/Contract.html?va=IF\">期指持仓</a><a href=\"http://data.eastmoney.com/notices/\">公告大全</a><a href=\"http://data.eastmoney.com/xuangu/\">选股器</a></li>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ul_list[0].select('li')[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "e51ca6ff-fed4-4590-94c8-01c32d14c110",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<a href=\"http://data.eastmoney.com/center/\">特色</a>,\n",
       " <a href=\"http://data.eastmoney.com/stock/lhb.html\">龙虎榜单</a>,\n",
       " <a href=\"http://data.eastmoney.com/rzrq/\">融资融券</a>,\n",
       " <a href=\"http://data.eastmoney.com/gpzy/\">股权质押</a>,\n",
       " <a href=\"http://data.eastmoney.com/dzjy/default.html\">大宗交易</a>,\n",
       " <a href=\"http://data.eastmoney.com/jgdy/\">机构调研</a>,\n",
       " <a href=\"http://data.eastmoney.com/IF/Data/Contract.html?va=IF\">期指持仓</a>,\n",
       " <a href=\"http://data.eastmoney.com/notices/\">公告大全</a>,\n",
       " <a href=\"http://data.eastmoney.com/xuangu/\">选股器</a>]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a_list = ul_list[0].select('li')[0].select('a')\n",
    "a_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "94818060-33c0-4c7b-a157-2a83e29a20d7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<a href=\"http://data.eastmoney.com/center/\">特色</a>"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a_list[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "c122c43e-9af8-4c35-97ee-998ed7bbf516",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'特色'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a_list[0].text"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "16fa87d5-8a49-419b-990b-81aaade9f932",
   "metadata": {},
   "source": [
    "到底谁是href，一个一个尝试太慢了，python通用的__dict__方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "a42c629c-8992-42f3-856b-e9eaafc0ae74",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'parser_class': bs4.BeautifulSoup,\n",
       " 'name': 'a',\n",
       " 'namespace': None,\n",
       " 'prefix': None,\n",
       " 'known_xml': False,\n",
       " 'attrs': {'href': 'http://data.eastmoney.com/center/'},\n",
       " 'contents': ['特色'],\n",
       " 'parent': <li><a href=\"http://data.eastmoney.com/center/\">特色</a><a href=\"http://data.eastmoney.com/stock/lhb.html\">龙虎榜单</a><a href=\"http://data.eastmoney.com/rzrq/\">融资融券</a><a href=\"http://data.eastmoney.com/gpzy/\">股权质押</a><a href=\"http://data.eastmoney.com/dzjy/default.html\">大宗交易</a><a href=\"http://data.eastmoney.com/jgdy/\">机构调研</a><a href=\"http://data.eastmoney.com/IF/Data/Contract.html?va=IF\">期指持仓</a><a href=\"http://data.eastmoney.com/notices/\">公告大全</a><a href=\"http://data.eastmoney.com/xuangu/\">选股器</a></li>,\n",
       " 'previous_element': <li><a href=\"http://data.eastmoney.com/center/\">特色</a><a href=\"http://data.eastmoney.com/stock/lhb.html\">龙虎榜单</a><a href=\"http://data.eastmoney.com/rzrq/\">融资融券</a><a href=\"http://data.eastmoney.com/gpzy/\">股权质押</a><a href=\"http://data.eastmoney.com/dzjy/default.html\">大宗交易</a><a href=\"http://data.eastmoney.com/jgdy/\">机构调研</a><a href=\"http://data.eastmoney.com/IF/Data/Contract.html?va=IF\">期指持仓</a><a href=\"http://data.eastmoney.com/notices/\">公告大全</a><a href=\"http://data.eastmoney.com/xuangu/\">选股器</a></li>,\n",
       " 'next_element': '特色',\n",
       " 'next_sibling': <a href=\"http://data.eastmoney.com/stock/lhb.html\">龙虎榜单</a>,\n",
       " 'previous_sibling': None,\n",
       " 'hidden': False,\n",
       " 'can_be_empty_element': False,\n",
       " 'cdata_list_attributes': {'*': ['class', 'accesskey', 'dropzone'],\n",
       "  'a': ['rel', 'rev'],\n",
       "  'link': ['rel', 'rev'],\n",
       "  'td': ['headers'],\n",
       "  'th': ['headers'],\n",
       "  'form': ['accept-charset'],\n",
       "  'object': ['archive'],\n",
       "  'area': ['rel'],\n",
       "  'icon': ['sizes'],\n",
       "  'iframe': ['sandbox'],\n",
       "  'output': ['for']},\n",
       " 'preserve_whitespace_tags': {'pre', 'textarea'},\n",
       " 'interesting_string_types': (bs4.element.NavigableString, bs4.element.CData)}"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a_list[0].__dict__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "72506e66-0adb-4b49-acdf-c7cc6b0f0ced",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'href': 'http://data.eastmoney.com/center/'}"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a_list[0].attrs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "bc1651dc-64cc-4e2e-8ba6-4cb627978322",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'http://data.eastmoney.com/center/'"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a_list[0].attrs['href']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "07c6d4dc-462b-42b2-a882-91279bb2ffa7",
   "metadata": {},
   "source": [
    "### 不是真正的所见即所得"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a0d3bde1-8af4-4f46-aa09-d648aade7390",
   "metadata": {},
   "source": [
    "不是真正的所见即所得，需要配合selenium"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "385e9daf-bb35-4c86-8ca5-c61e2df4d1d6",
   "metadata": {},
   "source": [
    "## json解析"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f86f3325-b8ee-490e-b8a2-9292207bdeca",
   "metadata": {},
   "source": [
    "### F12找返回"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cbfa57dd-6c7f-46a1-b2f5-99f14953e789",
   "metadata": {},
   "source": [
    "前后端分离，是渲染后返回，还是返回后渲染"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9b32f29e-45df-4751-8c82-bd6ffd4ce27c",
   "metadata": {},
   "source": [
    "XHR 或者 JS 文件"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "231d7bb3-7110-4906-93d5-4ced3b483ea1",
   "metadata": {},
   "source": [
    "### 找到并请求"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "edd295d9-2698-4c45-a51b-a70ea65d8fc0",
   "metadata": {},
   "source": [
    "JSON的全称是JavaScript Object Notation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "3f1a2a68-f77b-497d-aa4d-1dc34c4abb46",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "adea3233-c569-41a5-989c-32823bbe72c7",
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp_zcfz_api = 'https://datacenter-web.eastmoney.com/api/data/v1/get?callback=jQuery112302767833538878348_1667601318887&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&pageSize=50&pageNumber=1&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")(REPORT_DATE%3D%272018-06-30%27)'"
   ]
  },
  {
   "cell_type": "raw",
   "id": "8995a7d0-2045-46d3-9059-b687fe04a418",
   "metadata": {
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "source": [
    "requests.get(tmp_zcfz_api).text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "b9f0eab5-b1c9-48d6-98b4-c977a7494a4e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 发现其实可以不加jquery\n",
    "tmp_zcfz_api = 'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&pageSize=50&pageNumber=1&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")(REPORT_DATE%3D%272018-06-30%27)'"
   ]
  },
  {
   "cell_type": "raw",
   "id": "4ebc733c-915a-4426-981f-30e5337d2415",
   "metadata": {
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "source": [
    "requests.get(tmp_zcfz_api).text"
   ]
  },
  {
   "cell_type": "raw",
   "id": "98d6ee9a-acc9-4fda-b4e5-e9b46b992f63",
   "metadata": {
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "source": [
    "json.loads(requests.get(tmp_zcfz_api).text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "701f1492-bbcc-4e21-bdfb-6ba49252113f",
   "metadata": {},
   "outputs": [],
   "source": [
    "#接口直接解析，优势 ：能发现页面没有的东西\n",
    "tmp_df = pd.DataFrame(json.loads(requests.get(tmp_zcfz_api).text)['result']['data'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "a1a08961-7044-47e0-ac0b-afd8913e2df9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SECUCODE</th>\n",
       "      <th>SECURITY_CODE</th>\n",
       "      <th>INDUSTRY_CODE</th>\n",
       "      <th>ORG_CODE</th>\n",
       "      <th>SECURITY_NAME_ABBR</th>\n",
       "      <th>INDUSTRY_NAME</th>\n",
       "      <th>MARKET</th>\n",
       "      <th>SECURITY_TYPE_CODE</th>\n",
       "      <th>TRADE_MARKET_CODE</th>\n",
       "      <th>DATE_TYPE_CODE</th>\n",
       "      <th>...</th>\n",
       "      <th>BORROW_FUND</th>\n",
       "      <th>BORROW_FUND_RATIO</th>\n",
       "      <th>AGENT_TRADE_SECURITY</th>\n",
       "      <th>ATS_RATIO</th>\n",
       "      <th>PREMIUM_RECE</th>\n",
       "      <th>PREMIUM_RECE_RATIO</th>\n",
       "      <th>SHORT_LOAN</th>\n",
       "      <th>SHORT_LOAN_RATIO</th>\n",
       "      <th>ADVANCE_PREMIUM</th>\n",
       "      <th>ADVANCE_PREMIUM_RATIO</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002396.SZ</td>\n",
       "      <td>002396</td>\n",
       "      <td>016015</td>\n",
       "      <td>10077425</td>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002217.SZ</td>\n",
       "      <td>002217</td>\n",
       "      <td>016079</td>\n",
       "      <td>10059933</td>\n",
       "      <td>合力泰</td>\n",
       "      <td>光学光电子</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>688283.SH</td>\n",
       "      <td>688283</td>\n",
       "      <td>016061</td>\n",
       "      <td>10528910</td>\n",
       "      <td>坤恒顺维</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>kcb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001006</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>688292.SH</td>\n",
       "      <td>688292</td>\n",
       "      <td>016014</td>\n",
       "      <td>10468173</td>\n",
       "      <td>浩瀚深度</td>\n",
       "      <td>互联网服务</td>\n",
       "      <td>kcb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001006</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>603042.SH</td>\n",
       "      <td>603042</td>\n",
       "      <td>016015</td>\n",
       "      <td>10495153</td>\n",
       "      <td>华脉科技</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>shzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>002323.SZ</td>\n",
       "      <td>002323</td>\n",
       "      <td>016030</td>\n",
       "      <td>10145138</td>\n",
       "      <td>雅博股份</td>\n",
       "      <td>装修建材</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>300311.SZ</td>\n",
       "      <td>300311</td>\n",
       "      <td>016057</td>\n",
       "      <td>10196296</td>\n",
       "      <td>任子行</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>301178.SZ</td>\n",
       "      <td>301178</td>\n",
       "      <td>016057</td>\n",
       "      <td>10493624</td>\n",
       "      <td>天亿马</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>None</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>300100.SZ</td>\n",
       "      <td>300100</td>\n",
       "      <td>016035</td>\n",
       "      <td>10137531</td>\n",
       "      <td>双林股份</td>\n",
       "      <td>汽车零部件</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>600671.SH</td>\n",
       "      <td>600671</td>\n",
       "      <td>016081</td>\n",
       "      <td>10003981</td>\n",
       "      <td>ST目药</td>\n",
       "      <td>中药</td>\n",
       "      <td>shzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001003</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>001317.SZ</td>\n",
       "      <td>001317</td>\n",
       "      <td>016003</td>\n",
       "      <td>10527232</td>\n",
       "      <td>三羊马</td>\n",
       "      <td>物流行业</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>688579.SH</td>\n",
       "      <td>688579</td>\n",
       "      <td>016057</td>\n",
       "      <td>10092164</td>\n",
       "      <td>山大地纬</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>kcb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001006</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>300363.SZ</td>\n",
       "      <td>300363</td>\n",
       "      <td>016024</td>\n",
       "      <td>10181847</td>\n",
       "      <td>博腾股份</td>\n",
       "      <td>化学制药</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>300540.SZ</td>\n",
       "      <td>300540</td>\n",
       "      <td>016061</td>\n",
       "      <td>10401486</td>\n",
       "      <td>蜀道装备</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>000893.SZ</td>\n",
       "      <td>000893</td>\n",
       "      <td>016051</td>\n",
       "      <td>10005764</td>\n",
       "      <td>亚钾国际</td>\n",
       "      <td>化肥行业</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>600057.SH</td>\n",
       "      <td>600057</td>\n",
       "      <td>016003</td>\n",
       "      <td>10002281</td>\n",
       "      <td>厦门象屿</td>\n",
       "      <td>物流行业</td>\n",
       "      <td>shzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>300461.SZ</td>\n",
       "      <td>300461</td>\n",
       "      <td>016061</td>\n",
       "      <td>10289397</td>\n",
       "      <td>田中精机</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>605589.SH</td>\n",
       "      <td>605589</td>\n",
       "      <td>016041</td>\n",
       "      <td>10288235</td>\n",
       "      <td>圣泉集团</td>\n",
       "      <td>化学制品</td>\n",
       "      <td>shzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>002742.SZ</td>\n",
       "      <td>002742</td>\n",
       "      <td>016004</td>\n",
       "      <td>10181871</td>\n",
       "      <td>ST三圣</td>\n",
       "      <td>水泥建材</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002005</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>301185.SZ</td>\n",
       "      <td>301185</td>\n",
       "      <td>016057</td>\n",
       "      <td>10552526</td>\n",
       "      <td>鸥玛软件</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>None</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>300324.SZ</td>\n",
       "      <td>300324</td>\n",
       "      <td>016014</td>\n",
       "      <td>10197802</td>\n",
       "      <td>旋极信息</td>\n",
       "      <td>互联网服务</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>300851.SZ</td>\n",
       "      <td>300851</td>\n",
       "      <td>016008</td>\n",
       "      <td>10610336</td>\n",
       "      <td>交大思诺</td>\n",
       "      <td>交运设备</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>002161.SZ</td>\n",
       "      <td>002161</td>\n",
       "      <td>016022</td>\n",
       "      <td>10098238</td>\n",
       "      <td>远望谷</td>\n",
       "      <td>电子元件</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>688199.SH</td>\n",
       "      <td>688199</td>\n",
       "      <td>016041</td>\n",
       "      <td>10162904</td>\n",
       "      <td>久日新材</td>\n",
       "      <td>化学制品</td>\n",
       "      <td>kcb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001006</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>688181.SH</td>\n",
       "      <td>688181</td>\n",
       "      <td>016079</td>\n",
       "      <td>10376700</td>\n",
       "      <td>八亿时空</td>\n",
       "      <td>光学光电子</td>\n",
       "      <td>kcb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001006</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>300723.SZ</td>\n",
       "      <td>300723</td>\n",
       "      <td>016024</td>\n",
       "      <td>10539644</td>\n",
       "      <td>一品红</td>\n",
       "      <td>化学制药</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>002113.SZ</td>\n",
       "      <td>002113</td>\n",
       "      <td>016087</td>\n",
       "      <td>10079734</td>\n",
       "      <td>ST天润</td>\n",
       "      <td>游戏</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002005</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>600684.SH</td>\n",
       "      <td>600684</td>\n",
       "      <td>016017</td>\n",
       "      <td>10003994</td>\n",
       "      <td>珠江股份</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>shzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>300442.SZ</td>\n",
       "      <td>300442</td>\n",
       "      <td>016061</td>\n",
       "      <td>10198651</td>\n",
       "      <td>润泽科技</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>300270.SZ</td>\n",
       "      <td>300270</td>\n",
       "      <td>016055</td>\n",
       "      <td>10173933</td>\n",
       "      <td>中威电子</td>\n",
       "      <td>计算机设备</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>000048.SZ</td>\n",
       "      <td>000048</td>\n",
       "      <td>016017</td>\n",
       "      <td>10004131</td>\n",
       "      <td>京基智农</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>300742.SZ</td>\n",
       "      <td>300742</td>\n",
       "      <td>016035</td>\n",
       "      <td>10638733</td>\n",
       "      <td>越博动力</td>\n",
       "      <td>汽车零部件</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>300183.SZ</td>\n",
       "      <td>300183</td>\n",
       "      <td>016056</td>\n",
       "      <td>10159836</td>\n",
       "      <td>东软载波</td>\n",
       "      <td>通信服务</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>300786.SZ</td>\n",
       "      <td>300786</td>\n",
       "      <td>016048</td>\n",
       "      <td>10191784</td>\n",
       "      <td>国林科技</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>002809.SZ</td>\n",
       "      <td>002809</td>\n",
       "      <td>016041</td>\n",
       "      <td>10362280</td>\n",
       "      <td>红墙股份</td>\n",
       "      <td>化学制品</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>300234.SZ</td>\n",
       "      <td>300234</td>\n",
       "      <td>016030</td>\n",
       "      <td>10165016</td>\n",
       "      <td>开尔新材</td>\n",
       "      <td>装修建材</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>688981.SH</td>\n",
       "      <td>688981</td>\n",
       "      <td>016077</td>\n",
       "      <td>10004588</td>\n",
       "      <td>中芯国际</td>\n",
       "      <td>半导体</td>\n",
       "      <td>kcb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001006</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>002200.SZ</td>\n",
       "      <td>002200</td>\n",
       "      <td>016009</td>\n",
       "      <td>10074480</td>\n",
       "      <td>ST交投</td>\n",
       "      <td>农牧饲渔</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002005</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>002775.SZ</td>\n",
       "      <td>002775</td>\n",
       "      <td>016005</td>\n",
       "      <td>10180384</td>\n",
       "      <td>文科园林</td>\n",
       "      <td>工程建设</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>300313.SZ</td>\n",
       "      <td>300313</td>\n",
       "      <td>016009</td>\n",
       "      <td>10194844</td>\n",
       "      <td>ST天山</td>\n",
       "      <td>农牧饲渔</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002005</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>000585.SZ</td>\n",
       "      <td>000585</td>\n",
       "      <td>016020</td>\n",
       "      <td>10005526</td>\n",
       "      <td>东电退</td>\n",
       "      <td>电网设备</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002005</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>300743.SZ</td>\n",
       "      <td>300743</td>\n",
       "      <td>016067</td>\n",
       "      <td>10541392</td>\n",
       "      <td>天地数码</td>\n",
       "      <td>非金属材料</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>300301.SZ</td>\n",
       "      <td>300301</td>\n",
       "      <td>016079</td>\n",
       "      <td>10188029</td>\n",
       "      <td>*ST长方</td>\n",
       "      <td>光学光电子</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002005</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>300192.SZ</td>\n",
       "      <td>300192</td>\n",
       "      <td>016060</td>\n",
       "      <td>10172834</td>\n",
       "      <td>科德教育</td>\n",
       "      <td>教育</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>001227.SZ</td>\n",
       "      <td>001227</td>\n",
       "      <td>016029</td>\n",
       "      <td>10055877</td>\n",
       "      <td>兰州银行</td>\n",
       "      <td>银行</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>301007.SZ</td>\n",
       "      <td>301007</td>\n",
       "      <td>016035</td>\n",
       "      <td>10095945</td>\n",
       "      <td>德迈仕</td>\n",
       "      <td>汽车零部件</td>\n",
       "      <td>None</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002002</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>600870.SH</td>\n",
       "      <td>600870</td>\n",
       "      <td>016014</td>\n",
       "      <td>10004314</td>\n",
       "      <td>退市厦华</td>\n",
       "      <td>互联网服务</td>\n",
       "      <td>shzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001003</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>300023.SZ</td>\n",
       "      <td>300023</td>\n",
       "      <td>016023</td>\n",
       "      <td>10141561</td>\n",
       "      <td>宝德退</td>\n",
       "      <td>石油行业</td>\n",
       "      <td>cyb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002005</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>600316.SH</td>\n",
       "      <td>600316</td>\n",
       "      <td>016034</td>\n",
       "      <td>10002509</td>\n",
       "      <td>洪都航空</td>\n",
       "      <td>航天航空</td>\n",
       "      <td>shzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001001001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>000996.SZ</td>\n",
       "      <td>000996</td>\n",
       "      <td>016063</td>\n",
       "      <td>10005848</td>\n",
       "      <td>中国中期</td>\n",
       "      <td>汽车服务</td>\n",
       "      <td>szzb</td>\n",
       "      <td>058001001</td>\n",
       "      <td>069001002001</td>\n",
       "      <td>002</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>50 rows × 57 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     SECUCODE SECURITY_CODE INDUSTRY_CODE  ORG_CODE SECURITY_NAME_ABBR  \\\n",
       "0   002396.SZ        002396        016015  10077425               星网锐捷   \n",
       "1   002217.SZ        002217        016079  10059933                合力泰   \n",
       "2   688283.SH        688283        016061  10528910               坤恒顺维   \n",
       "3   688292.SH        688292        016014  10468173               浩瀚深度   \n",
       "4   603042.SH        603042        016015  10495153               华脉科技   \n",
       "5   002323.SZ        002323        016030  10145138               雅博股份   \n",
       "6   300311.SZ        300311        016057  10196296                任子行   \n",
       "7   301178.SZ        301178        016057  10493624                天亿马   \n",
       "8   300100.SZ        300100        016035  10137531               双林股份   \n",
       "9   600671.SH        600671        016081  10003981               ST目药   \n",
       "10  001317.SZ        001317        016003  10527232                三羊马   \n",
       "11  688579.SH        688579        016057  10092164               山大地纬   \n",
       "12  300363.SZ        300363        016024  10181847               博腾股份   \n",
       "13  300540.SZ        300540        016061  10401486               蜀道装备   \n",
       "14  000893.SZ        000893        016051  10005764               亚钾国际   \n",
       "15  600057.SH        600057        016003  10002281               厦门象屿   \n",
       "16  300461.SZ        300461        016061  10289397               田中精机   \n",
       "17  605589.SH        605589        016041  10288235               圣泉集团   \n",
       "18  002742.SZ        002742        016004  10181871               ST三圣   \n",
       "19  301185.SZ        301185        016057  10552526               鸥玛软件   \n",
       "20  300324.SZ        300324        016014  10197802               旋极信息   \n",
       "21  300851.SZ        300851        016008  10610336               交大思诺   \n",
       "22  002161.SZ        002161        016022  10098238                远望谷   \n",
       "23  688199.SH        688199        016041  10162904               久日新材   \n",
       "24  688181.SH        688181        016079  10376700               八亿时空   \n",
       "25  300723.SZ        300723        016024  10539644                一品红   \n",
       "26  002113.SZ        002113        016087  10079734               ST天润   \n",
       "27  600684.SH        600684        016017  10003994               珠江股份   \n",
       "28  300442.SZ        300442        016061  10198651               润泽科技   \n",
       "29  300270.SZ        300270        016055  10173933               中威电子   \n",
       "30  000048.SZ        000048        016017  10004131               京基智农   \n",
       "31  300742.SZ        300742        016035  10638733               越博动力   \n",
       "32  300183.SZ        300183        016056  10159836               东软载波   \n",
       "33  300786.SZ        300786        016048  10191784               国林科技   \n",
       "34  002809.SZ        002809        016041  10362280               红墙股份   \n",
       "35  300234.SZ        300234        016030  10165016               开尔新材   \n",
       "36  688981.SH        688981        016077  10004588               中芯国际   \n",
       "37  002200.SZ        002200        016009  10074480               ST交投   \n",
       "38  002775.SZ        002775        016005  10180384               文科园林   \n",
       "39  300313.SZ        300313        016009  10194844               ST天山   \n",
       "40  000585.SZ        000585        016020  10005526                东电退   \n",
       "41  300743.SZ        300743        016067  10541392               天地数码   \n",
       "42  300301.SZ        300301        016079  10188029              *ST长方   \n",
       "43  300192.SZ        300192        016060  10172834               科德教育   \n",
       "44  001227.SZ        001227        016029  10055877               兰州银行   \n",
       "45  301007.SZ        301007        016035  10095945                德迈仕   \n",
       "46  600870.SH        600870        016014  10004314               退市厦华   \n",
       "47  300023.SZ        300023        016023  10141561                宝德退   \n",
       "48  600316.SH        600316        016034  10002509               洪都航空   \n",
       "49  000996.SZ        000996        016063  10005848               中国中期   \n",
       "\n",
       "   INDUSTRY_NAME MARKET SECURITY_TYPE_CODE TRADE_MARKET_CODE DATE_TYPE_CODE  \\\n",
       "0           通信设备   szzb          058001001      069001002001            002   \n",
       "1          光学光电子   szzb          058001001      069001002001            002   \n",
       "2           专用设备    kcb          058001001      069001001006            002   \n",
       "3          互联网服务    kcb          058001001      069001001006            002   \n",
       "4           通信设备   shzb          058001001      069001001001            002   \n",
       "5           装修建材   szzb          058001001      069001002001            002   \n",
       "6           软件开发    cyb          058001001      069001002002            002   \n",
       "7           软件开发   None          058001001      069001002002            002   \n",
       "8          汽车零部件    cyb          058001001      069001002002            002   \n",
       "9             中药   shzb          058001001      069001001003            002   \n",
       "10          物流行业   szzb          058001001      069001002001            002   \n",
       "11          软件开发    kcb          058001001      069001001006            002   \n",
       "12          化学制药    cyb          058001001      069001002002            002   \n",
       "13          专用设备    cyb          058001001      069001002002            002   \n",
       "14          化肥行业   szzb          058001001      069001002001            002   \n",
       "15          物流行业   shzb          058001001      069001001001            002   \n",
       "16          专用设备    cyb          058001001      069001002002            002   \n",
       "17          化学制品   shzb          058001001      069001001001            002   \n",
       "18          水泥建材   szzb          058001001      069001002005            002   \n",
       "19          软件开发   None          058001001      069001002002            002   \n",
       "20         互联网服务    cyb          058001001      069001002002            002   \n",
       "21          交运设备    cyb          058001001      069001002002            002   \n",
       "22          电子元件   szzb          058001001      069001002001            002   \n",
       "23          化学制品    kcb          058001001      069001001006            002   \n",
       "24         光学光电子    kcb          058001001      069001001006            002   \n",
       "25          化学制药    cyb          058001001      069001002002            002   \n",
       "26            游戏   szzb          058001001      069001002005            002   \n",
       "27         房地产开发   shzb          058001001      069001001001            002   \n",
       "28          专用设备    cyb          058001001      069001002002            002   \n",
       "29         计算机设备    cyb          058001001      069001002002            002   \n",
       "30         房地产开发   szzb          058001001      069001002001            002   \n",
       "31         汽车零部件    cyb          058001001      069001002002            002   \n",
       "32          通信服务    cyb          058001001      069001002002            002   \n",
       "33          环保行业    cyb          058001001      069001002002            002   \n",
       "34          化学制品   szzb          058001001      069001002001            002   \n",
       "35          装修建材    cyb          058001001      069001002002            002   \n",
       "36           半导体    kcb          058001001      069001001006            002   \n",
       "37          农牧饲渔   szzb          058001001      069001002005            002   \n",
       "38          工程建设   szzb          058001001      069001002001            002   \n",
       "39          农牧饲渔    cyb          058001001      069001002005            002   \n",
       "40          电网设备   szzb          058001001      069001002005            002   \n",
       "41         非金属材料    cyb          058001001      069001002002            002   \n",
       "42         光学光电子    cyb          058001001      069001002005            002   \n",
       "43            教育    cyb          058001001      069001002002            002   \n",
       "44            银行   szzb          058001001      069001002001            002   \n",
       "45         汽车零部件   None          058001001      069001002002            002   \n",
       "46         互联网服务   shzb          058001001      069001001003            002   \n",
       "47          石油行业    cyb          058001001      069001002005            002   \n",
       "48          航天航空   shzb          058001001      069001001001            002   \n",
       "49          汽车服务   szzb          058001001      069001002001            002   \n",
       "\n",
       "    ... BORROW_FUND BORROW_FUND_RATIO AGENT_TRADE_SECURITY ATS_RATIO  \\\n",
       "0   ...        None              None                 None      None   \n",
       "1   ...        None              None                 None      None   \n",
       "2   ...        None              None                 None      None   \n",
       "3   ...        None              None                 None      None   \n",
       "4   ...        None              None                 None      None   \n",
       "5   ...        None              None                 None      None   \n",
       "6   ...        None              None                 None      None   \n",
       "7   ...        None              None                 None      None   \n",
       "8   ...        None              None                 None      None   \n",
       "9   ...        None              None                 None      None   \n",
       "10  ...        None              None                 None      None   \n",
       "11  ...        None              None                 None      None   \n",
       "12  ...        None              None                 None      None   \n",
       "13  ...        None              None                 None      None   \n",
       "14  ...        None              None                 None      None   \n",
       "15  ...        None              None                 None      None   \n",
       "16  ...        None              None                 None      None   \n",
       "17  ...        None              None                 None      None   \n",
       "18  ...        None              None                 None      None   \n",
       "19  ...        None              None                 None      None   \n",
       "20  ...        None              None                 None      None   \n",
       "21  ...        None              None                 None      None   \n",
       "22  ...        None              None                 None      None   \n",
       "23  ...        None              None                 None      None   \n",
       "24  ...        None              None                 None      None   \n",
       "25  ...        None              None                 None      None   \n",
       "26  ...        None              None                 None      None   \n",
       "27  ...        None              None                 None      None   \n",
       "28  ...        None              None                 None      None   \n",
       "29  ...        None              None                 None      None   \n",
       "30  ...        None              None                 None      None   \n",
       "31  ...        None              None                 None      None   \n",
       "32  ...        None              None                 None      None   \n",
       "33  ...        None              None                 None      None   \n",
       "34  ...        None              None                 None      None   \n",
       "35  ...        None              None                 None      None   \n",
       "36  ...        None              None                 None      None   \n",
       "37  ...        None              None                 None      None   \n",
       "38  ...        None              None                 None      None   \n",
       "39  ...        None              None                 None      None   \n",
       "40  ...        None              None                 None      None   \n",
       "41  ...        None              None                 None      None   \n",
       "42  ...        None              None                 None      None   \n",
       "43  ...        None              None                 None      None   \n",
       "44  ...        None              None                 None      None   \n",
       "45  ...        None              None                 None      None   \n",
       "46  ...        None              None                 None      None   \n",
       "47  ...        None              None                 None      None   \n",
       "48  ...        None              None                 None      None   \n",
       "49  ...        None              None                 None      None   \n",
       "\n",
       "    PREMIUM_RECE  PREMIUM_RECE_RATIO  SHORT_LOAN  SHORT_LOAN_RATIO  \\\n",
       "0           None                None        None              None   \n",
       "1           None                None        None              None   \n",
       "2           None                None        None              None   \n",
       "3           None                None        None              None   \n",
       "4           None                None        None              None   \n",
       "5           None                None        None              None   \n",
       "6           None                None        None              None   \n",
       "7           None                None        None              None   \n",
       "8           None                None        None              None   \n",
       "9           None                None        None              None   \n",
       "10          None                None        None              None   \n",
       "11          None                None        None              None   \n",
       "12          None                None        None              None   \n",
       "13          None                None        None              None   \n",
       "14          None                None        None              None   \n",
       "15          None                None        None              None   \n",
       "16          None                None        None              None   \n",
       "17          None                None        None              None   \n",
       "18          None                None        None              None   \n",
       "19          None                None        None              None   \n",
       "20          None                None        None              None   \n",
       "21          None                None        None              None   \n",
       "22          None                None        None              None   \n",
       "23          None                None        None              None   \n",
       "24          None                None        None              None   \n",
       "25          None                None        None              None   \n",
       "26          None                None        None              None   \n",
       "27          None                None        None              None   \n",
       "28          None                None        None              None   \n",
       "29          None                None        None              None   \n",
       "30          None                None        None              None   \n",
       "31          None                None        None              None   \n",
       "32          None                None        None              None   \n",
       "33          None                None        None              None   \n",
       "34          None                None        None              None   \n",
       "35          None                None        None              None   \n",
       "36          None                None        None              None   \n",
       "37          None                None        None              None   \n",
       "38          None                None        None              None   \n",
       "39          None                None        None              None   \n",
       "40          None                None        None              None   \n",
       "41          None                None        None              None   \n",
       "42          None                None        None              None   \n",
       "43          None                None        None              None   \n",
       "44          None                None        None              None   \n",
       "45          None                None        None              None   \n",
       "46          None                None        None              None   \n",
       "47          None                None        None              None   \n",
       "48          None                None        None              None   \n",
       "49          None                None        None              None   \n",
       "\n",
       "    ADVANCE_PREMIUM  ADVANCE_PREMIUM_RATIO  \n",
       "0              None                   None  \n",
       "1              None                   None  \n",
       "2              None                   None  \n",
       "3              None                   None  \n",
       "4              None                   None  \n",
       "5              None                   None  \n",
       "6              None                   None  \n",
       "7              None                   None  \n",
       "8              None                   None  \n",
       "9              None                   None  \n",
       "10             None                   None  \n",
       "11             None                   None  \n",
       "12             None                   None  \n",
       "13             None                   None  \n",
       "14             None                   None  \n",
       "15             None                   None  \n",
       "16             None                   None  \n",
       "17             None                   None  \n",
       "18             None                   None  \n",
       "19             None                   None  \n",
       "20             None                   None  \n",
       "21             None                   None  \n",
       "22             None                   None  \n",
       "23             None                   None  \n",
       "24             None                   None  \n",
       "25             None                   None  \n",
       "26             None                   None  \n",
       "27             None                   None  \n",
       "28             None                   None  \n",
       "29             None                   None  \n",
       "30             None                   None  \n",
       "31             None                   None  \n",
       "32             None                   None  \n",
       "33             None                   None  \n",
       "34             None                   None  \n",
       "35             None                   None  \n",
       "36             None                   None  \n",
       "37             None                   None  \n",
       "38             None                   None  \n",
       "39             None                   None  \n",
       "40             None                   None  \n",
       "41             None                   None  \n",
       "42             None                   None  \n",
       "43             None                   None  \n",
       "44             None                   None  \n",
       "45             None                   None  \n",
       "46             None                   None  \n",
       "47             None                   None  \n",
       "48             None                   None  \n",
       "49             None                   None  \n",
       "\n",
       "[50 rows x 57 columns]"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "c9b0753f-33d8-44c6-8e70-8fac4ef04076",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "SECUCODE                               002396.SZ\n",
       "SECURITY_CODE                             002396\n",
       "INDUSTRY_CODE                             016015\n",
       "ORG_CODE                                10077425\n",
       "SECURITY_NAME_ABBR                          星网锐捷\n",
       "INDUSTRY_NAME                               通信设备\n",
       "MARKET                                      szzb\n",
       "SECURITY_TYPE_CODE                     058001001\n",
       "TRADE_MARKET_CODE                   069001002001\n",
       "DATE_TYPE_CODE                               002\n",
       "REPORT_TYPE_CODE                             001\n",
       "DATA_STATE                                     2\n",
       "NOTICE_DATE                  2022-09-24 00:00:00\n",
       "REPORT_DATE                  2018-06-30 00:00:00\n",
       "TOTAL_ASSETS                       5909188090.59\n",
       "FIXED_ASSET                         487215058.33\n",
       "MONETARYFUNDS                       828635691.05\n",
       "MONETARYFUNDS_RATIO                    13.498974\n",
       "ACCOUNTS_RECE                       1633618054.8\n",
       "ACCOUNTS_RECE_RATIO                    32.271949\n",
       "INVENTORY                          1616252743.41\n",
       "INVENTORY_RATIO                        30.699329\n",
       "TOTAL_LIABILITIES                  2296649242.86\n",
       "ACCOUNTS_PAYABLE                    921307458.15\n",
       "ACCOUNTS_PAYABLE_RATIO                  9.922815\n",
       "ADVANCE_RECEIVABLES                   90469658.4\n",
       "ADVANCE_RECEIVABLES_RATIO                6.79142\n",
       "TOTAL_EQUITY                       3612538847.73\n",
       "TOTAL_EQUITY_RATIO                      1.747714\n",
       "TOTAL_ASSETS_RATIO                      13.01895\n",
       "TOTAL_LIAB_RATIO                       36.867707\n",
       "CURRENT_RATIO                          200.48069\n",
       "DEBT_ASSET_RATIO                       38.865733\n",
       "CASH_DEPOSIT_PBC                             NaN\n",
       "CDP_RATIO                                    NaN\n",
       "LOAN_ADVANCE                                 NaN\n",
       "LOAN_ADVANCE_RATIO                           NaN\n",
       "AVAILABLE_SALE_FINASSET                      NaN\n",
       "ASF_RATIO                                    NaN\n",
       "LOAN_PBC                                     NaN\n",
       "LOAN_PBC_RATIO                               NaN\n",
       "ACCEPT_DEPOSIT                               NaN\n",
       "ACCEPT_DEPOSIT_RATIO                         NaN\n",
       "SELL_REPO_FINASSET                           NaN\n",
       "SRF_RATIO                                    NaN\n",
       "SETTLE_EXCESS_RESERVE                       None\n",
       "SER_RATIO                                   None\n",
       "BORROW_FUND                                 None\n",
       "BORROW_FUND_RATIO                           None\n",
       "AGENT_TRADE_SECURITY                        None\n",
       "ATS_RATIO                                   None\n",
       "PREMIUM_RECE                                None\n",
       "PREMIUM_RECE_RATIO                          None\n",
       "SHORT_LOAN                                  None\n",
       "SHORT_LOAN_RATIO                            None\n",
       "ADVANCE_PREMIUM                             None\n",
       "ADVANCE_PREMIUM_RATIO                       None\n",
       "Name: 0, dtype: object"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_df.iloc[0, :]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "cadd9b51-ef01-4880-bc4f-3e53daa927d3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 结合网址去查看\n",
    "zcfz_name2code_dict = {\n",
    "    '股票代码': 'SECUCODE'\n",
    "    ,'股票简称': 'SECURITY_NAME_ABBR'\n",
    "    ,'行业名称': 'INDUSTRY_NAME'\n",
    "    ,'公告日期': 'REPORT_DATE'\n",
    "    ,'总资产': 'TOTAL_ASSETS'\n",
    "    ,'固定资产': 'FIXED_ASSET'\n",
    "    ,'货币资金': 'MONETARYFUNDS'\n",
    "    ,'应收账款': 'ACCOUNTS_RECE'\n",
    "    ,'存货': 'INVENTORY'\n",
    "    ,'总负债': 'TOTAL_LIABILITIES'\n",
    "    ,'应付账款': 'ACCOUNTS_PAYABLE'\n",
    "    ,'预收账款': 'ADVANCE_RECEIVABLES'\n",
    "    ,'所有者权益': 'TOTAL_EQUITY'\n",
    "}\n",
    "zcfz_code2name_dict = {v:k for k,v in zcfz_name2code_dict.items()}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "6b4e60e8-24e0-4435-90ea-7a6480f729e3",
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp_df_filter = tmp_df.loc[:, zcfz_code2name_dict]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "325aa726-aebd-4fbc-a48a-5cf88c696be9",
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp_df_filter = tmp_df_filter.rename(columns=zcfz_code2name_dict)"
   ]
  },
  {
   "cell_type": "raw",
   "id": "14b4daaf-bb17-494b-a2d6-fb75e761d2c6",
   "metadata": {},
   "source": [
    "tmp_df_filter"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "be4120b1-75bf-4165-b3ac-55f63ac29556",
   "metadata": {},
   "source": [
    "## requests总结"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5c8ae956-510e-4253-9451-6951c8d34dd0",
   "metadata": {},
   "source": [
    "不仅可以用来爬虫，还可以做接口测试"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b0a2866f-690f-4b28-a2b7-6cfd17e8ac86",
   "metadata": {},
   "source": [
    "# 利润表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "a203c94d-2e35-4a6a-8534-b391e1a17291",
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp_lrb_api = 'https://datacenter-web.eastmoney.com/api/data/v1/get?sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&pageSize=500&pageNumber=8&reportName=RPT_DMSK_FN_INCOME&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(%22058001001%22%2C%22058001008%22))(TRADE_MARKET_CODE!%3D%22069001017%22)(REPORT_DATE%3D%272018-06-30%27)'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "51b32b63-fa22-4f1f-9359-e68bc951efd7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(429, 46)"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#接口直接解析，优势 ：能发现页面没有的东西\n",
    "tmp_df = pd.DataFrame(json.loads(requests.get(tmp_lrb_api).text)['result']['data'])\n",
    "tmp_df.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c49314c4-c446-46c4-b1f6-20930384c5fd",
   "metadata": {},
   "source": [
    "https://emweb.securities.eastmoney.com/PC_HSF10/FinanceAnalysis/Index?type=web&code=SZ002396#lrb-0"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4b5eacf1-8357-4687-988b-0797dec80168",
   "metadata": {},
   "source": [
    "有个坑：净利润没有值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "61b3c1c0-c560-404c-975b-b5a037a861f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "SECUCODE                             002271.SZ\n",
       "SECURITY_CODE                           002271\n",
       "INDUSTRY_CODE                           016030\n",
       "ORG_CODE                              10119110\n",
       "SECURITY_NAME_ABBR                        东方雨虹\n",
       "INDUSTRY_NAME                             装修建材\n",
       "MARKET                                    szzb\n",
       "SECURITY_TYPE_CODE                   058001001\n",
       "TRADE_MARKET_CODE                 069001002001\n",
       "DATE_TYPE_CODE                             002\n",
       "REPORT_TYPE_CODE                           001\n",
       "DATA_STATE                                   2\n",
       "NOTICE_DATE                2019-08-09 00:00:00\n",
       "REPORT_DATE                2018-06-30 00:00:00\n",
       "PARENT_NETPROFIT                  618414793.65\n",
       "TOTAL_OPERATE_INCOME             5613003955.89\n",
       "TOTAL_OPERATE_COST               4908899553.27\n",
       "TOE_RATIO                            32.776189\n",
       "OPERATE_COST                     3540984885.03\n",
       "OPERATE_EXPENSE                  3540984885.03\n",
       "OPERATE_EXPENSE_RATIO                37.862962\n",
       "SALE_EXPENSE                      704416884.43\n",
       "MANAGE_EXPENSE                    439390750.05\n",
       "FINANCE_EXPENSE                    63052866.43\n",
       "OPERATE_PROFIT                    708621417.63\n",
       "TOTAL_PROFIT                      707980133.74\n",
       "INCOME_TAX                         90719685.21\n",
       "OPERATE_INCOME                             NaN\n",
       "INTEREST_NI                                NaN\n",
       "INTEREST_NI_RATIO                          NaN\n",
       "FEE_COMMISSION_NI                          NaN\n",
       "FCN_RATIO                                 None\n",
       "OPERATE_TAX_ADD                    59058692.37\n",
       "MANAGE_EXPENSE_BANK                        NaN\n",
       "FCN_CALCULATE                              NaN\n",
       "INTEREST_NI_CALCULATE                      NaN\n",
       "EARNED_PREMIUM                            None\n",
       "EARNED_PREMIUM_RATIO                      None\n",
       "INVEST_INCOME                             None\n",
       "SURRENDER_VALUE                           None\n",
       "COMPENSATE_EXPENSE                        None\n",
       "TOI_RATIO                            30.214262\n",
       "OPERATE_PROFIT_RATIO                 27.032406\n",
       "PARENT_NETPROFIT_RATIO               25.256455\n",
       "DEDUCT_PARENT_NETPROFIT           528442767.37\n",
       "DPN_RATIO                             12.32774\n",
       "Name: 0, dtype: object"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_df.iloc[0,:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "254126c9-158c-4870-818e-c49e378b1899",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 结合网址去查看\n",
    "lrb_name2code_dict = {\n",
    "    '股票代码': 'SECUCODE'\n",
    "    ,'股票简称': 'SECURITY_NAME_ABBR'\n",
    "    ,'行业名称': 'INDUSTRY_NAME'\n",
    "    ,'公告日期': 'REPORT_DATE'\n",
    "    ,'营业收入': 'TOTAL_OPERATE_INCOME'\n",
    "    ,'营业成本': 'OPERATE_COST'\n",
    "    ,'销售费用': 'SALE_EXPENSE'\n",
    "    ,'管理费用': 'MANAGE_EXPENSE'\n",
    "    ,'财务费用': 'FINANCE_EXPENSE'\n",
    "    ,'营业总支出': 'TOTAL_OPERATE_COST'\n",
    "    ,'营业利润': 'OPERATE_PROFIT'\n",
    "    ,'利润总额': 'TOTAL_PROFIT'\n",
    "    ,'所得税费用': 'INCOME_TAX'\n",
    "    ,'净利润': 'OPERATE_INCOME'\n",
    "}\n",
    "lrb_code2name_dict = {v:k for k,v in lrb_name2code_dict.items()}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "3233cc9d-183e-490e-8e4e-b250d0b9cb86",
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp_df_filter = tmp_df.loc[:, lrb_code2name_dict]\n",
    "tmp_df_filter = tmp_df_filter.rename(columns=lrb_code2name_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "940885dc-9cd2-45a0-9491-cb4309cd56c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票代码</th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>公告日期</th>\n",
       "      <th>营业收入</th>\n",
       "      <th>营业成本</th>\n",
       "      <th>销售费用</th>\n",
       "      <th>管理费用</th>\n",
       "      <th>财务费用</th>\n",
       "      <th>营业总支出</th>\n",
       "      <th>营业利润</th>\n",
       "      <th>利润总额</th>\n",
       "      <th>所得税费用</th>\n",
       "      <th>净利润</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002271.SZ</td>\n",
       "      <td>东方雨虹</td>\n",
       "      <td>装修建材</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>5.613004e+09</td>\n",
       "      <td>3.540985e+09</td>\n",
       "      <td>7.044169e+08</td>\n",
       "      <td>4.393908e+08</td>\n",
       "      <td>6.305287e+07</td>\n",
       "      <td>4.908900e+09</td>\n",
       "      <td>7.086214e+08</td>\n",
       "      <td>7.079801e+08</td>\n",
       "      <td>9.071969e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>000962.SZ</td>\n",
       "      <td>东方钽业</td>\n",
       "      <td>小金属</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>5.175089e+08</td>\n",
       "      <td>4.628046e+08</td>\n",
       "      <td>4.699835e+06</td>\n",
       "      <td>4.519304e+07</td>\n",
       "      <td>1.453015e+07</td>\n",
       "      <td>5.373698e+08</td>\n",
       "      <td>-1.915655e+07</td>\n",
       "      <td>-1.911814e+07</td>\n",
       "      <td>4.865427e+04</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>000793.SZ</td>\n",
       "      <td>华闻集团</td>\n",
       "      <td>文化传媒</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.437139e+09</td>\n",
       "      <td>1.036539e+09</td>\n",
       "      <td>1.753124e+08</td>\n",
       "      <td>1.807353e+08</td>\n",
       "      <td>1.074690e+08</td>\n",
       "      <td>1.521074e+09</td>\n",
       "      <td>1.151382e+08</td>\n",
       "      <td>1.194329e+08</td>\n",
       "      <td>2.828683e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>000791.SZ</td>\n",
       "      <td>甘肃电投</td>\n",
       "      <td>电力行业</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>9.274491e+08</td>\n",
       "      <td>5.392176e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.236103e+07</td>\n",
       "      <td>2.858467e+08</td>\n",
       "      <td>8.511282e+08</td>\n",
       "      <td>1.375362e+08</td>\n",
       "      <td>1.477749e+08</td>\n",
       "      <td>1.366941e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>000779.SZ</td>\n",
       "      <td>甘咨询</td>\n",
       "      <td>工程咨询服务</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>8.903767e+08</td>\n",
       "      <td>5.779261e+08</td>\n",
       "      <td>7.836212e+06</td>\n",
       "      <td>1.435605e+08</td>\n",
       "      <td>2.717787e+06</td>\n",
       "      <td>7.490202e+08</td>\n",
       "      <td>1.384960e+08</td>\n",
       "      <td>1.504722e+08</td>\n",
       "      <td>2.342021e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>422</th>\n",
       "      <td>301002.SZ</td>\n",
       "      <td>崧盛股份</td>\n",
       "      <td>电网设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.926792e+08</td>\n",
       "      <td>1.427878e+08</td>\n",
       "      <td>8.385319e+06</td>\n",
       "      <td>4.917170e+06</td>\n",
       "      <td>1.567064e+05</td>\n",
       "      <td>1.680020e+08</td>\n",
       "      <td>2.607684e+07</td>\n",
       "      <td>2.607241e+07</td>\n",
       "      <td>3.260919e+06</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>423</th>\n",
       "      <td>301190.SZ</td>\n",
       "      <td>善水科技</td>\n",
       "      <td>化学制品</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.092314e+08</td>\n",
       "      <td>1.069097e+08</td>\n",
       "      <td>3.205906e+06</td>\n",
       "      <td>1.799902e+07</td>\n",
       "      <td>2.060581e+05</td>\n",
       "      <td>1.370518e+08</td>\n",
       "      <td>7.287176e+07</td>\n",
       "      <td>7.960832e+07</td>\n",
       "      <td>1.164694e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>424</th>\n",
       "      <td>300902.SZ</td>\n",
       "      <td>国安达</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.061279e+08</td>\n",
       "      <td>4.365951e+07</td>\n",
       "      <td>9.767434e+06</td>\n",
       "      <td>1.405172e+07</td>\n",
       "      <td>-8.965192e+04</td>\n",
       "      <td>7.406893e+07</td>\n",
       "      <td>3.302001e+07</td>\n",
       "      <td>3.308370e+07</td>\n",
       "      <td>4.686553e+06</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>425</th>\n",
       "      <td>688357.SH</td>\n",
       "      <td>建龙微纳</td>\n",
       "      <td>非金属材料</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.802191e+08</td>\n",
       "      <td>1.213500e+08</td>\n",
       "      <td>1.281001e+07</td>\n",
       "      <td>5.933503e+06</td>\n",
       "      <td>8.298190e+06</td>\n",
       "      <td>1.561608e+08</td>\n",
       "      <td>2.457030e+07</td>\n",
       "      <td>2.446204e+07</td>\n",
       "      <td>3.348314e+06</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>426</th>\n",
       "      <td>601825.SH</td>\n",
       "      <td>沪农商行</td>\n",
       "      <td>银行</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>9.305863e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.674509e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.776476e+09</td>\n",
       "      <td>4.529387e+09</td>\n",
       "      <td>4.578095e+09</td>\n",
       "      <td>7.385002e+08</td>\n",
       "      <td>9.305863e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>427 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          股票代码  股票简称    行业名称                 公告日期          营业收入          营业成本  \\\n",
       "0    002271.SZ  东方雨虹    装修建材  2018-06-30 00:00:00  5.613004e+09  3.540985e+09   \n",
       "1    000962.SZ  东方钽业     小金属  2018-06-30 00:00:00  5.175089e+08  4.628046e+08   \n",
       "2    000793.SZ  华闻集团    文化传媒  2018-06-30 00:00:00  1.437139e+09  1.036539e+09   \n",
       "3    000791.SZ  甘肃电投    电力行业  2018-06-30 00:00:00  9.274491e+08  5.392176e+08   \n",
       "4    000779.SZ   甘咨询  工程咨询服务  2018-06-30 00:00:00  8.903767e+08  5.779261e+08   \n",
       "..         ...   ...     ...                  ...           ...           ...   \n",
       "422  301002.SZ  崧盛股份    电网设备  2018-06-30 00:00:00  1.926792e+08  1.427878e+08   \n",
       "423  301190.SZ  善水科技    化学制品  2018-06-30 00:00:00  2.092314e+08  1.069097e+08   \n",
       "424  300902.SZ   国安达    专用设备  2018-06-30 00:00:00  1.061279e+08  4.365951e+07   \n",
       "425  688357.SH  建龙微纳   非金属材料  2018-06-30 00:00:00  1.802191e+08  1.213500e+08   \n",
       "426  601825.SH  沪农商行      银行  2018-06-30 00:00:00  9.305863e+09           NaN   \n",
       "\n",
       "             销售费用          管理费用          财务费用         营业总支出          营业利润  \\\n",
       "0    7.044169e+08  4.393908e+08  6.305287e+07  4.908900e+09  7.086214e+08   \n",
       "1    4.699835e+06  4.519304e+07  1.453015e+07  5.373698e+08 -1.915655e+07   \n",
       "2    1.753124e+08  1.807353e+08  1.074690e+08  1.521074e+09  1.151382e+08   \n",
       "3             NaN  1.236103e+07  2.858467e+08  8.511282e+08  1.375362e+08   \n",
       "4    7.836212e+06  1.435605e+08  2.717787e+06  7.490202e+08  1.384960e+08   \n",
       "..            ...           ...           ...           ...           ...   \n",
       "422  8.385319e+06  4.917170e+06  1.567064e+05  1.680020e+08  2.607684e+07   \n",
       "423  3.205906e+06  1.799902e+07  2.060581e+05  1.370518e+08  7.287176e+07   \n",
       "424  9.767434e+06  1.405172e+07 -8.965192e+04  7.406893e+07  3.302001e+07   \n",
       "425  1.281001e+07  5.933503e+06  8.298190e+06  1.561608e+08  2.457030e+07   \n",
       "426           NaN  2.674509e+09           NaN  4.776476e+09  4.529387e+09   \n",
       "\n",
       "             利润总额         所得税费用           净利润  \n",
       "0    7.079801e+08  9.071969e+07           NaN  \n",
       "1   -1.911814e+07  4.865427e+04           NaN  \n",
       "2    1.194329e+08  2.828683e+07           NaN  \n",
       "3    1.477749e+08  1.366941e+07           NaN  \n",
       "4    1.504722e+08  2.342021e+07           NaN  \n",
       "..            ...           ...           ...  \n",
       "422  2.607241e+07  3.260919e+06           NaN  \n",
       "423  7.960832e+07  1.164694e+07           NaN  \n",
       "424  3.308370e+07  4.686553e+06           NaN  \n",
       "425  2.446204e+07  3.348314e+06           NaN  \n",
       "426  4.578095e+09  7.385002e+08  9.305863e+09  \n",
       "\n",
       "[427 rows x 14 columns]"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_df_filter"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8c5ba0c3-f45d-4c1b-9c1a-f34cb8858465",
   "metadata": {},
   "source": [
    "# 循环获取"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "db0ad349-3f98-47db-bc97-362018254cff",
   "metadata": {},
   "source": [
    "## 先简单进行函数封装"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "6f604f6f-5cf6-409a-ad23-cefbb986e2a7",
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_zcfz_df(api, code2name_dict):\n",
    "    zcfz_df = pd.DataFrame(json.loads(requests.get(api).text)['result']['data'])\n",
    "    zcfz_df = zcfz_df.loc[:, code2name_dict]\n",
    "    zcfz_df = zcfz_df.rename(columns=code2name_dict)\n",
    "    return zcfz_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "842b34fc-af24-4b2e-974a-e297ac7d4497",
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_lrb_df(api, code2name_dict):\n",
    "    lrb_df = pd.DataFrame(json.loads(requests.get(api).text)['result']['data'])\n",
    "    lrb_df = lrb_df.loc[:, code2name_dict]\n",
    "    lrb_df = lrb_df.rename(columns=code2name_dict)\n",
    "    return lrb_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "b2371baf-ff7c-4cd6-9525-f17e161ee118",
   "metadata": {},
   "outputs": [],
   "source": [
    "zcfz_api = 'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "'pageSize=50&pageNumber=1&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "'(REPORT_DATE%3D%272018-06-30%27)'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "81b185bd-31ed-4e3e-83ee-ba789c3a5aa5",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票代码</th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>公告日期</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002396.SZ</td>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>5.909188e+09</td>\n",
       "      <td>4.872151e+08</td>\n",
       "      <td>8.286357e+08</td>\n",
       "      <td>1.633618e+09</td>\n",
       "      <td>1.616253e+09</td>\n",
       "      <td>2.296649e+09</td>\n",
       "      <td>9.213075e+08</td>\n",
       "      <td>9.046966e+07</td>\n",
       "      <td>3.612539e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002217.SZ</td>\n",
       "      <td>合力泰</td>\n",
       "      <td>光学光电子</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.484988e+10</td>\n",
       "      <td>3.104059e+09</td>\n",
       "      <td>2.932068e+09</td>\n",
       "      <td>6.330803e+09</td>\n",
       "      <td>3.838704e+09</td>\n",
       "      <td>1.415100e+10</td>\n",
       "      <td>3.067305e+09</td>\n",
       "      <td>9.165447e+07</td>\n",
       "      <td>1.069888e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>688283.SH</td>\n",
       "      <td>坤恒顺维</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>5.614557e+07</td>\n",
       "      <td>3.481604e+06</td>\n",
       "      <td>3.898409e+06</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.410694e+07</td>\n",
       "      <td>1.379742e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.169172e+06</td>\n",
       "      <td>4.234815e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>688292.SH</td>\n",
       "      <td>浩瀚深度</td>\n",
       "      <td>互联网服务</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.491499e+08</td>\n",
       "      <td>5.589526e+06</td>\n",
       "      <td>2.911328e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.015240e+08</td>\n",
       "      <td>2.135899e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.675781e+07</td>\n",
       "      <td>2.355600e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>603042.SH</td>\n",
       "      <td>华脉科技</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.950402e+09</td>\n",
       "      <td>1.585586e+08</td>\n",
       "      <td>1.317277e+08</td>\n",
       "      <td>8.981480e+08</td>\n",
       "      <td>2.390261e+08</td>\n",
       "      <td>1.001849e+09</td>\n",
       "      <td>4.589113e+08</td>\n",
       "      <td>1.596035e+07</td>\n",
       "      <td>9.485532e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>002323.SZ</td>\n",
       "      <td>雅博股份</td>\n",
       "      <td>装修建材</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.446695e+09</td>\n",
       "      <td>2.134245e+07</td>\n",
       "      <td>5.126169e+06</td>\n",
       "      <td>8.412936e+08</td>\n",
       "      <td>8.863558e+08</td>\n",
       "      <td>1.642991e+09</td>\n",
       "      <td>5.325716e+08</td>\n",
       "      <td>5.825937e+06</td>\n",
       "      <td>8.037032e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>300311.SZ</td>\n",
       "      <td>任子行</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.092129e+09</td>\n",
       "      <td>1.754737e+08</td>\n",
       "      <td>3.119926e+08</td>\n",
       "      <td>4.518731e+08</td>\n",
       "      <td>1.808518e+08</td>\n",
       "      <td>1.102903e+09</td>\n",
       "      <td>2.725822e+08</td>\n",
       "      <td>1.793280e+08</td>\n",
       "      <td>9.892258e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>301178.SZ</td>\n",
       "      <td>天亿马</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.631616e+08</td>\n",
       "      <td>3.685644e+06</td>\n",
       "      <td>6.052771e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.553602e+07</td>\n",
       "      <td>8.984870e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.428491e+07</td>\n",
       "      <td>1.733129e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>300100.SZ</td>\n",
       "      <td>双林股份</td>\n",
       "      <td>汽车零部件</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>6.585758e+09</td>\n",
       "      <td>1.397232e+09</td>\n",
       "      <td>4.619158e+08</td>\n",
       "      <td>9.194790e+08</td>\n",
       "      <td>8.195325e+08</td>\n",
       "      <td>3.661225e+09</td>\n",
       "      <td>7.389265e+08</td>\n",
       "      <td>8.370922e+06</td>\n",
       "      <td>2.924533e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>600671.SH</td>\n",
       "      <td>ST目药</td>\n",
       "      <td>中药</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.479528e+08</td>\n",
       "      <td>1.429377e+08</td>\n",
       "      <td>1.424851e+07</td>\n",
       "      <td>6.284510e+07</td>\n",
       "      <td>6.318853e+07</td>\n",
       "      <td>3.408687e+08</td>\n",
       "      <td>4.727578e+07</td>\n",
       "      <td>2.231678e+06</td>\n",
       "      <td>1.070842e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>001317.SZ</td>\n",
       "      <td>三羊马</td>\n",
       "      <td>物流行业</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>7.112810e+08</td>\n",
       "      <td>1.192762e+08</td>\n",
       "      <td>1.331690e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.001779e+07</td>\n",
       "      <td>3.505816e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.740990e+06</td>\n",
       "      <td>3.606994e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>688579.SH</td>\n",
       "      <td>山大地纬</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>6.716052e+08</td>\n",
       "      <td>8.778589e+07</td>\n",
       "      <td>3.319348e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6.388466e+07</td>\n",
       "      <td>1.766928e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.119852e+08</td>\n",
       "      <td>4.949125e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>300363.SZ</td>\n",
       "      <td>博腾股份</td>\n",
       "      <td>化学制药</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.636512e+09</td>\n",
       "      <td>1.442094e+09</td>\n",
       "      <td>1.718260e+09</td>\n",
       "      <td>3.345640e+08</td>\n",
       "      <td>3.108993e+08</td>\n",
       "      <td>1.710895e+09</td>\n",
       "      <td>2.370229e+08</td>\n",
       "      <td>5.795724e+06</td>\n",
       "      <td>2.925617e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>300540.SZ</td>\n",
       "      <td>蜀道装备</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.017040e+09</td>\n",
       "      <td>1.360658e+07</td>\n",
       "      <td>1.679047e+08</td>\n",
       "      <td>5.145967e+08</td>\n",
       "      <td>6.828721e+07</td>\n",
       "      <td>3.551837e+08</td>\n",
       "      <td>1.352781e+08</td>\n",
       "      <td>1.249013e+08</td>\n",
       "      <td>6.618560e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>000893.SZ</td>\n",
       "      <td>亚钾国际</td>\n",
       "      <td>化肥行业</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.208168e+09</td>\n",
       "      <td>6.510132e+08</td>\n",
       "      <td>4.650282e+08</td>\n",
       "      <td>1.539704e+07</td>\n",
       "      <td>5.040858e+07</td>\n",
       "      <td>3.276652e+08</td>\n",
       "      <td>2.459698e+08</td>\n",
       "      <td>1.457894e+07</td>\n",
       "      <td>3.880503e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>600057.SH</td>\n",
       "      <td>厦门象屿</td>\n",
       "      <td>物流行业</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>5.689751e+10</td>\n",
       "      <td>6.865635e+09</td>\n",
       "      <td>4.159271e+09</td>\n",
       "      <td>4.068569e+09</td>\n",
       "      <td>1.687647e+10</td>\n",
       "      <td>4.012624e+10</td>\n",
       "      <td>5.540928e+09</td>\n",
       "      <td>7.893200e+09</td>\n",
       "      <td>1.677127e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>300461.SZ</td>\n",
       "      <td>田中精机</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.536897e+09</td>\n",
       "      <td>1.091063e+08</td>\n",
       "      <td>1.272773e+08</td>\n",
       "      <td>3.751217e+08</td>\n",
       "      <td>3.935987e+08</td>\n",
       "      <td>1.054203e+09</td>\n",
       "      <td>3.641190e+08</td>\n",
       "      <td>4.391573e+07</td>\n",
       "      <td>4.826938e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>605589.SH</td>\n",
       "      <td>圣泉集团</td>\n",
       "      <td>化学制品</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>7.855059e+09</td>\n",
       "      <td>1.706556e+09</td>\n",
       "      <td>1.514601e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8.617460e+08</td>\n",
       "      <td>3.829109e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.915657e+07</td>\n",
       "      <td>4.025950e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>002742.SZ</td>\n",
       "      <td>ST三圣</td>\n",
       "      <td>水泥建材</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.427168e+09</td>\n",
       "      <td>9.236043e+08</td>\n",
       "      <td>3.390183e+08</td>\n",
       "      <td>1.274136e+09</td>\n",
       "      <td>2.478985e+08</td>\n",
       "      <td>2.727853e+09</td>\n",
       "      <td>4.088837e+08</td>\n",
       "      <td>2.844161e+07</td>\n",
       "      <td>1.699315e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>301185.SZ</td>\n",
       "      <td>鸥玛软件</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.656429e+08</td>\n",
       "      <td>4.712930e+07</td>\n",
       "      <td>6.563312e+07</td>\n",
       "      <td>3.169081e+07</td>\n",
       "      <td>3.235523e+06</td>\n",
       "      <td>1.403381e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.670975e+05</td>\n",
       "      <td>1.516091e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>300324.SZ</td>\n",
       "      <td>旋极信息</td>\n",
       "      <td>互联网服务</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>7.518562e+09</td>\n",
       "      <td>3.625138e+08</td>\n",
       "      <td>1.872690e+09</td>\n",
       "      <td>1.069556e+09</td>\n",
       "      <td>8.576342e+08</td>\n",
       "      <td>2.252813e+09</td>\n",
       "      <td>8.195636e+08</td>\n",
       "      <td>4.407797e+08</td>\n",
       "      <td>5.265749e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>300851.SZ</td>\n",
       "      <td>交大思诺</td>\n",
       "      <td>交运设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.605844e+08</td>\n",
       "      <td>8.656971e+07</td>\n",
       "      <td>3.996310e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.092662e+08</td>\n",
       "      <td>1.030198e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.384641e+07</td>\n",
       "      <td>3.575646e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>002161.SZ</td>\n",
       "      <td>远望谷</td>\n",
       "      <td>电子元件</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.449104e+09</td>\n",
       "      <td>2.589062e+08</td>\n",
       "      <td>1.992043e+08</td>\n",
       "      <td>2.184737e+08</td>\n",
       "      <td>2.809394e+08</td>\n",
       "      <td>9.125218e+08</td>\n",
       "      <td>1.020320e+08</td>\n",
       "      <td>1.763854e+07</td>\n",
       "      <td>1.536583e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>688199.SH</td>\n",
       "      <td>久日新材</td>\n",
       "      <td>化学制品</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.196807e+09</td>\n",
       "      <td>3.579350e+08</td>\n",
       "      <td>1.727623e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.602341e+08</td>\n",
       "      <td>5.115530e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.439584e+06</td>\n",
       "      <td>6.852536e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>688181.SH</td>\n",
       "      <td>八亿时空</td>\n",
       "      <td>光学光电子</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>6.499252e+08</td>\n",
       "      <td>3.045724e+08</td>\n",
       "      <td>1.964286e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8.968453e+07</td>\n",
       "      <td>1.630548e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.719977e+06</td>\n",
       "      <td>4.868703e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>300723.SZ</td>\n",
       "      <td>一品红</td>\n",
       "      <td>化学制药</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.732333e+09</td>\n",
       "      <td>1.693526e+08</td>\n",
       "      <td>4.611478e+08</td>\n",
       "      <td>2.847519e+08</td>\n",
       "      <td>8.326589e+07</td>\n",
       "      <td>5.563117e+08</td>\n",
       "      <td>4.464948e+07</td>\n",
       "      <td>2.772175e+07</td>\n",
       "      <td>1.176022e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>002113.SZ</td>\n",
       "      <td>ST天润</td>\n",
       "      <td>游戏</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.896383e+09</td>\n",
       "      <td>3.093957e+06</td>\n",
       "      <td>3.379999e+08</td>\n",
       "      <td>9.718253e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.326026e+08</td>\n",
       "      <td>8.370590e+07</td>\n",
       "      <td>2.448511e+06</td>\n",
       "      <td>2.363780e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>600684.SH</td>\n",
       "      <td>珠江股份</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.666228e+10</td>\n",
       "      <td>8.371079e+08</td>\n",
       "      <td>2.102076e+09</td>\n",
       "      <td>1.202968e+07</td>\n",
       "      <td>5.351419e+09</td>\n",
       "      <td>1.339093e+10</td>\n",
       "      <td>4.574848e+08</td>\n",
       "      <td>1.912615e+08</td>\n",
       "      <td>4.226243e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>300442.SZ</td>\n",
       "      <td>润泽科技</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.667123e+09</td>\n",
       "      <td>3.812794e+08</td>\n",
       "      <td>4.841714e+07</td>\n",
       "      <td>3.770003e+08</td>\n",
       "      <td>4.632795e+08</td>\n",
       "      <td>6.998168e+08</td>\n",
       "      <td>3.132918e+08</td>\n",
       "      <td>9.126765e+07</td>\n",
       "      <td>9.673058e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>300270.SZ</td>\n",
       "      <td>中威电子</td>\n",
       "      <td>计算机设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.542273e+09</td>\n",
       "      <td>2.589537e+08</td>\n",
       "      <td>4.205469e+08</td>\n",
       "      <td>3.312836e+08</td>\n",
       "      <td>1.069542e+08</td>\n",
       "      <td>4.715049e+08</td>\n",
       "      <td>2.071976e+08</td>\n",
       "      <td>4.623591e+06</td>\n",
       "      <td>1.070768e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>000048.SZ</td>\n",
       "      <td>京基智农</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.670533e+09</td>\n",
       "      <td>6.109323e+08</td>\n",
       "      <td>1.171115e+09</td>\n",
       "      <td>5.066310e+07</td>\n",
       "      <td>1.742460e+09</td>\n",
       "      <td>3.919388e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.765884e+09</td>\n",
       "      <td>7.511454e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>300742.SZ</td>\n",
       "      <td>越博动力</td>\n",
       "      <td>汽车零部件</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.502816e+09</td>\n",
       "      <td>1.617853e+08</td>\n",
       "      <td>4.158191e+08</td>\n",
       "      <td>1.155014e+09</td>\n",
       "      <td>9.206876e+07</td>\n",
       "      <td>1.367742e+09</td>\n",
       "      <td>4.049032e+08</td>\n",
       "      <td>1.225246e+05</td>\n",
       "      <td>1.135074e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>300183.SZ</td>\n",
       "      <td>东软载波</td>\n",
       "      <td>通信服务</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.988484e+09</td>\n",
       "      <td>2.355971e+08</td>\n",
       "      <td>1.313797e+09</td>\n",
       "      <td>3.160796e+08</td>\n",
       "      <td>1.749869e+08</td>\n",
       "      <td>3.516418e+08</td>\n",
       "      <td>1.242941e+08</td>\n",
       "      <td>2.414178e+07</td>\n",
       "      <td>2.636843e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>300786.SZ</td>\n",
       "      <td>国林科技</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>5.352999e+08</td>\n",
       "      <td>1.287351e+08</td>\n",
       "      <td>4.725879e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.752284e+08</td>\n",
       "      <td>1.681040e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.016413e+07</td>\n",
       "      <td>3.671959e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>002809.SZ</td>\n",
       "      <td>红墙股份</td>\n",
       "      <td>化学制品</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.354065e+09</td>\n",
       "      <td>8.016627e+07</td>\n",
       "      <td>4.249919e+08</td>\n",
       "      <td>4.087958e+08</td>\n",
       "      <td>4.617880e+07</td>\n",
       "      <td>3.788484e+08</td>\n",
       "      <td>3.676952e+07</td>\n",
       "      <td>1.427714e+07</td>\n",
       "      <td>9.752162e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>300234.SZ</td>\n",
       "      <td>开尔新材</td>\n",
       "      <td>装修建材</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.193151e+09</td>\n",
       "      <td>2.502349e+08</td>\n",
       "      <td>8.626309e+07</td>\n",
       "      <td>2.391986e+08</td>\n",
       "      <td>1.944064e+08</td>\n",
       "      <td>1.914142e+08</td>\n",
       "      <td>7.799890e+07</td>\n",
       "      <td>7.672079e+07</td>\n",
       "      <td>1.001736e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>688981.SH</td>\n",
       "      <td>中芯国际</td>\n",
       "      <td>半导体</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.288385e+10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.269093e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.614756e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>002200.SZ</td>\n",
       "      <td>ST交投</td>\n",
       "      <td>农牧饲渔</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>3.249807e+09</td>\n",
       "      <td>6.506825e+07</td>\n",
       "      <td>3.252273e+08</td>\n",
       "      <td>4.660741e+08</td>\n",
       "      <td>1.276274e+09</td>\n",
       "      <td>2.881714e+09</td>\n",
       "      <td>5.309311e+08</td>\n",
       "      <td>2.811395e+07</td>\n",
       "      <td>3.680930e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>002775.SZ</td>\n",
       "      <td>文科园林</td>\n",
       "      <td>工程建设</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>3.752643e+09</td>\n",
       "      <td>2.381243e+07</td>\n",
       "      <td>9.333764e+08</td>\n",
       "      <td>6.799987e+08</td>\n",
       "      <td>9.441826e+08</td>\n",
       "      <td>1.332536e+09</td>\n",
       "      <td>3.701157e+08</td>\n",
       "      <td>7.986374e+07</td>\n",
       "      <td>2.420108e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>300313.SZ</td>\n",
       "      <td>ST天山</td>\n",
       "      <td>农牧饲渔</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.290905e+09</td>\n",
       "      <td>3.340812e+08</td>\n",
       "      <td>8.308848e+07</td>\n",
       "      <td>2.104713e+07</td>\n",
       "      <td>5.403053e+07</td>\n",
       "      <td>9.984302e+08</td>\n",
       "      <td>4.830681e+07</td>\n",
       "      <td>9.026646e+06</td>\n",
       "      <td>2.924752e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>000585.SZ</td>\n",
       "      <td>东电退</td>\n",
       "      <td>电网设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.946045e+08</td>\n",
       "      <td>1.316833e+07</td>\n",
       "      <td>4.052789e+07</td>\n",
       "      <td>2.138924e+07</td>\n",
       "      <td>7.655336e+06</td>\n",
       "      <td>5.033557e+08</td>\n",
       "      <td>1.230424e+07</td>\n",
       "      <td>3.799934e+06</td>\n",
       "      <td>-2.087512e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>300743.SZ</td>\n",
       "      <td>天地数码</td>\n",
       "      <td>非金属材料</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>5.105488e+08</td>\n",
       "      <td>1.260186e+08</td>\n",
       "      <td>1.804729e+08</td>\n",
       "      <td>8.695286e+07</td>\n",
       "      <td>7.288997e+07</td>\n",
       "      <td>1.250748e+08</td>\n",
       "      <td>3.813027e+07</td>\n",
       "      <td>2.937489e+06</td>\n",
       "      <td>3.854739e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>300301.SZ</td>\n",
       "      <td>*ST长方</td>\n",
       "      <td>光学光电子</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>3.628119e+09</td>\n",
       "      <td>1.159194e+09</td>\n",
       "      <td>3.369579e+08</td>\n",
       "      <td>6.344616e+08</td>\n",
       "      <td>3.794047e+08</td>\n",
       "      <td>1.259936e+09</td>\n",
       "      <td>2.503173e+08</td>\n",
       "      <td>1.466495e+07</td>\n",
       "      <td>2.368183e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>300192.SZ</td>\n",
       "      <td>科德教育</td>\n",
       "      <td>教育</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.635879e+09</td>\n",
       "      <td>2.700772e+08</td>\n",
       "      <td>2.546482e+08</td>\n",
       "      <td>1.202184e+08</td>\n",
       "      <td>9.904896e+07</td>\n",
       "      <td>7.842456e+08</td>\n",
       "      <td>8.033357e+07</td>\n",
       "      <td>9.053150e+07</td>\n",
       "      <td>8.516332e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>001227.SZ</td>\n",
       "      <td>兰州银行</td>\n",
       "      <td>银行</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.680199e+11</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.480590e+11</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.996090e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>301007.SZ</td>\n",
       "      <td>德迈仕</td>\n",
       "      <td>汽车零部件</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.013908e+08</td>\n",
       "      <td>1.618250e+08</td>\n",
       "      <td>2.694892e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6.031365e+07</td>\n",
       "      <td>1.422160e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.390048e+05</td>\n",
       "      <td>2.591748e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>600870.SH</td>\n",
       "      <td>退市厦华</td>\n",
       "      <td>互联网服务</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.977683e+07</td>\n",
       "      <td>6.791161e+04</td>\n",
       "      <td>2.464021e+07</td>\n",
       "      <td>7.847593e+06</td>\n",
       "      <td>2.918647e+06</td>\n",
       "      <td>5.371097e+07</td>\n",
       "      <td>1.705439e+06</td>\n",
       "      <td>4.026336e+06</td>\n",
       "      <td>-3.934142e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>300023.SZ</td>\n",
       "      <td>宝德退</td>\n",
       "      <td>石油行业</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>6.652303e+09</td>\n",
       "      <td>1.241117e+08</td>\n",
       "      <td>6.610700e+08</td>\n",
       "      <td>2.409885e+07</td>\n",
       "      <td>1.815971e+07</td>\n",
       "      <td>5.496327e+09</td>\n",
       "      <td>7.148456e+06</td>\n",
       "      <td>6.932595e+06</td>\n",
       "      <td>1.155976e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>600316.SH</td>\n",
       "      <td>洪都航空</td>\n",
       "      <td>航天航空</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>9.712269e+09</td>\n",
       "      <td>2.031866e+09</td>\n",
       "      <td>2.598488e+08</td>\n",
       "      <td>5.652223e+08</td>\n",
       "      <td>4.163416e+09</td>\n",
       "      <td>4.867095e+09</td>\n",
       "      <td>1.400400e+09</td>\n",
       "      <td>1.623544e+08</td>\n",
       "      <td>4.845175e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>000996.SZ</td>\n",
       "      <td>中国中期</td>\n",
       "      <td>汽车服务</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>6.002636e+08</td>\n",
       "      <td>3.615670e+06</td>\n",
       "      <td>1.330454e+08</td>\n",
       "      <td>2.424738e+05</td>\n",
       "      <td>2.234599e+07</td>\n",
       "      <td>6.381474e+07</td>\n",
       "      <td>5.664258e+05</td>\n",
       "      <td>8.102667e+05</td>\n",
       "      <td>5.364489e+08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         股票代码   股票简称   行业名称                 公告日期           总资产          固定资产  \\\n",
       "0   002396.SZ   星网锐捷   通信设备  2018-06-30 00:00:00  5.909188e+09  4.872151e+08   \n",
       "1   002217.SZ    合力泰  光学光电子  2018-06-30 00:00:00  2.484988e+10  3.104059e+09   \n",
       "2   688283.SH   坤恒顺维   专用设备  2018-06-30 00:00:00  5.614557e+07  3.481604e+06   \n",
       "3   688292.SH   浩瀚深度  互联网服务  2018-06-30 00:00:00  4.491499e+08  5.589526e+06   \n",
       "4   603042.SH   华脉科技   通信设备  2018-06-30 00:00:00  1.950402e+09  1.585586e+08   \n",
       "5   002323.SZ   雅博股份   装修建材  2018-06-30 00:00:00  2.446695e+09  2.134245e+07   \n",
       "6   300311.SZ    任子行   软件开发  2018-06-30 00:00:00  2.092129e+09  1.754737e+08   \n",
       "7   301178.SZ    天亿马   软件开发  2018-06-30 00:00:00  2.631616e+08  3.685644e+06   \n",
       "8   300100.SZ   双林股份  汽车零部件  2018-06-30 00:00:00  6.585758e+09  1.397232e+09   \n",
       "9   600671.SH   ST目药     中药  2018-06-30 00:00:00  4.479528e+08  1.429377e+08   \n",
       "10  001317.SZ    三羊马   物流行业  2018-06-30 00:00:00  7.112810e+08  1.192762e+08   \n",
       "11  688579.SH   山大地纬   软件开发  2018-06-30 00:00:00  6.716052e+08  8.778589e+07   \n",
       "12  300363.SZ   博腾股份   化学制药  2018-06-30 00:00:00  4.636512e+09  1.442094e+09   \n",
       "13  300540.SZ   蜀道装备   专用设备  2018-06-30 00:00:00  1.017040e+09  1.360658e+07   \n",
       "14  000893.SZ   亚钾国际   化肥行业  2018-06-30 00:00:00  4.208168e+09  6.510132e+08   \n",
       "15  600057.SH   厦门象屿   物流行业  2018-06-30 00:00:00  5.689751e+10  6.865635e+09   \n",
       "16  300461.SZ   田中精机   专用设备  2018-06-30 00:00:00  1.536897e+09  1.091063e+08   \n",
       "17  605589.SH   圣泉集团   化学制品  2018-06-30 00:00:00  7.855059e+09  1.706556e+09   \n",
       "18  002742.SZ   ST三圣   水泥建材  2018-06-30 00:00:00  4.427168e+09  9.236043e+08   \n",
       "19  301185.SZ   鸥玛软件   软件开发  2018-06-30 00:00:00  1.656429e+08  4.712930e+07   \n",
       "20  300324.SZ   旋极信息  互联网服务  2018-06-30 00:00:00  7.518562e+09  3.625138e+08   \n",
       "21  300851.SZ   交大思诺   交运设备  2018-06-30 00:00:00  4.605844e+08  8.656971e+07   \n",
       "22  002161.SZ    远望谷   电子元件  2018-06-30 00:00:00  2.449104e+09  2.589062e+08   \n",
       "23  688199.SH   久日新材   化学制品  2018-06-30 00:00:00  1.196807e+09  3.579350e+08   \n",
       "24  688181.SH   八亿时空  光学光电子  2018-06-30 00:00:00  6.499252e+08  3.045724e+08   \n",
       "25  300723.SZ    一品红   化学制药  2018-06-30 00:00:00  1.732333e+09  1.693526e+08   \n",
       "26  002113.SZ   ST天润     游戏  2018-06-30 00:00:00  2.896383e+09  3.093957e+06   \n",
       "27  600684.SH   珠江股份  房地产开发  2018-06-30 00:00:00  1.666228e+10  8.371079e+08   \n",
       "28  300442.SZ   润泽科技   专用设备  2018-06-30 00:00:00  1.667123e+09  3.812794e+08   \n",
       "29  300270.SZ   中威电子  计算机设备  2018-06-30 00:00:00  1.542273e+09  2.589537e+08   \n",
       "30  000048.SZ   京基智农  房地产开发  2018-06-30 00:00:00  4.670533e+09  6.109323e+08   \n",
       "31  300742.SZ   越博动力  汽车零部件  2018-06-30 00:00:00  2.502816e+09  1.617853e+08   \n",
       "32  300183.SZ   东软载波   通信服务  2018-06-30 00:00:00  2.988484e+09  2.355971e+08   \n",
       "33  300786.SZ   国林科技   环保行业  2018-06-30 00:00:00  5.352999e+08  1.287351e+08   \n",
       "34  002809.SZ   红墙股份   化学制品  2018-06-30 00:00:00  1.354065e+09  8.016627e+07   \n",
       "35  300234.SZ   开尔新材   装修建材  2018-06-30 00:00:00  1.193151e+09  2.502349e+08   \n",
       "36  688981.SH   中芯国际    半导体  2018-06-30 00:00:00  1.288385e+10           NaN   \n",
       "37  002200.SZ   ST交投   农牧饲渔  2018-06-30 00:00:00  3.249807e+09  6.506825e+07   \n",
       "38  002775.SZ   文科园林   工程建设  2018-06-30 00:00:00  3.752643e+09  2.381243e+07   \n",
       "39  300313.SZ   ST天山   农牧饲渔  2018-06-30 00:00:00  1.290905e+09  3.340812e+08   \n",
       "40  000585.SZ    东电退   电网设备  2018-06-30 00:00:00  2.946045e+08  1.316833e+07   \n",
       "41  300743.SZ   天地数码  非金属材料  2018-06-30 00:00:00  5.105488e+08  1.260186e+08   \n",
       "42  300301.SZ  *ST长方  光学光电子  2018-06-30 00:00:00  3.628119e+09  1.159194e+09   \n",
       "43  300192.SZ   科德教育     教育  2018-06-30 00:00:00  1.635879e+09  2.700772e+08   \n",
       "44  001227.SZ   兰州银行     银行  2018-06-30 00:00:00  2.680199e+11           NaN   \n",
       "45  301007.SZ    德迈仕  汽车零部件  2018-06-30 00:00:00  4.013908e+08  1.618250e+08   \n",
       "46  600870.SH   退市厦华  互联网服务  2018-06-30 00:00:00  4.977683e+07  6.791161e+04   \n",
       "47  300023.SZ    宝德退   石油行业  2018-06-30 00:00:00  6.652303e+09  1.241117e+08   \n",
       "48  600316.SH   洪都航空   航天航空  2018-06-30 00:00:00  9.712269e+09  2.031866e+09   \n",
       "49  000996.SZ   中国中期   汽车服务  2018-06-30 00:00:00  6.002636e+08  3.615670e+06   \n",
       "\n",
       "            货币资金          应收账款            存货           总负债          应付账款  \\\n",
       "0   8.286357e+08  1.633618e+09  1.616253e+09  2.296649e+09  9.213075e+08   \n",
       "1   2.932068e+09  6.330803e+09  3.838704e+09  1.415100e+10  3.067305e+09   \n",
       "2   3.898409e+06           NaN  1.410694e+07  1.379742e+07           NaN   \n",
       "3   2.911328e+07           NaN  2.015240e+08  2.135899e+08           NaN   \n",
       "4   1.317277e+08  8.981480e+08  2.390261e+08  1.001849e+09  4.589113e+08   \n",
       "5   5.126169e+06  8.412936e+08  8.863558e+08  1.642991e+09  5.325716e+08   \n",
       "6   3.119926e+08  4.518731e+08  1.808518e+08  1.102903e+09  2.725822e+08   \n",
       "7   6.052771e+07           NaN  4.553602e+07  8.984870e+07           NaN   \n",
       "8   4.619158e+08  9.194790e+08  8.195325e+08  3.661225e+09  7.389265e+08   \n",
       "9   1.424851e+07  6.284510e+07  6.318853e+07  3.408687e+08  4.727578e+07   \n",
       "10  1.331690e+08           NaN  1.001779e+07  3.505816e+08           NaN   \n",
       "11  3.319348e+07           NaN  6.388466e+07  1.766928e+08           NaN   \n",
       "12  1.718260e+09  3.345640e+08  3.108993e+08  1.710895e+09  2.370229e+08   \n",
       "13  1.679047e+08  5.145967e+08  6.828721e+07  3.551837e+08  1.352781e+08   \n",
       "14  4.650282e+08  1.539704e+07  5.040858e+07  3.276652e+08  2.459698e+08   \n",
       "15  4.159271e+09  4.068569e+09  1.687647e+10  4.012624e+10  5.540928e+09   \n",
       "16  1.272773e+08  3.751217e+08  3.935987e+08  1.054203e+09  3.641190e+08   \n",
       "17  1.514601e+09           NaN  8.617460e+08  3.829109e+09           NaN   \n",
       "18  3.390183e+08  1.274136e+09  2.478985e+08  2.727853e+09  4.088837e+08   \n",
       "19  6.563312e+07  3.169081e+07  3.235523e+06  1.403381e+07           NaN   \n",
       "20  1.872690e+09  1.069556e+09  8.576342e+08  2.252813e+09  8.195636e+08   \n",
       "21  3.996310e+07           NaN  1.092662e+08  1.030198e+08           NaN   \n",
       "22  1.992043e+08  2.184737e+08  2.809394e+08  9.125218e+08  1.020320e+08   \n",
       "23  1.727623e+08           NaN  1.602341e+08  5.115530e+08           NaN   \n",
       "24  1.964286e+07           NaN  8.968453e+07  1.630548e+08           NaN   \n",
       "25  4.611478e+08  2.847519e+08  8.326589e+07  5.563117e+08  4.464948e+07   \n",
       "26  3.379999e+08  9.718253e+07           NaN  5.326026e+08  8.370590e+07   \n",
       "27  2.102076e+09  1.202968e+07  5.351419e+09  1.339093e+10  4.574848e+08   \n",
       "28  4.841714e+07  3.770003e+08  4.632795e+08  6.998168e+08  3.132918e+08   \n",
       "29  4.205469e+08  3.312836e+08  1.069542e+08  4.715049e+08  2.071976e+08   \n",
       "30  1.171115e+09  5.066310e+07  1.742460e+09  3.919388e+09           NaN   \n",
       "31  4.158191e+08  1.155014e+09  9.206876e+07  1.367742e+09  4.049032e+08   \n",
       "32  1.313797e+09  3.160796e+08  1.749869e+08  3.516418e+08  1.242941e+08   \n",
       "33  4.725879e+07           NaN  1.752284e+08  1.681040e+08           NaN   \n",
       "34  4.249919e+08  4.087958e+08  4.617880e+07  3.788484e+08  3.676952e+07   \n",
       "35  8.626309e+07  2.391986e+08  1.944064e+08  1.914142e+08  7.799890e+07   \n",
       "36           NaN           NaN           NaN  5.269093e+09           NaN   \n",
       "37  3.252273e+08  4.660741e+08  1.276274e+09  2.881714e+09  5.309311e+08   \n",
       "38  9.333764e+08  6.799987e+08  9.441826e+08  1.332536e+09  3.701157e+08   \n",
       "39  8.308848e+07  2.104713e+07  5.403053e+07  9.984302e+08  4.830681e+07   \n",
       "40  4.052789e+07  2.138924e+07  7.655336e+06  5.033557e+08  1.230424e+07   \n",
       "41  1.804729e+08  8.695286e+07  7.288997e+07  1.250748e+08  3.813027e+07   \n",
       "42  3.369579e+08  6.344616e+08  3.794047e+08  1.259936e+09  2.503173e+08   \n",
       "43  2.546482e+08  1.202184e+08  9.904896e+07  7.842456e+08  8.033357e+07   \n",
       "44           NaN           NaN           NaN  2.480590e+11           NaN   \n",
       "45  2.694892e+07           NaN  6.031365e+07  1.422160e+08           NaN   \n",
       "46  2.464021e+07  7.847593e+06  2.918647e+06  5.371097e+07  1.705439e+06   \n",
       "47  6.610700e+08  2.409885e+07  1.815971e+07  5.496327e+09  7.148456e+06   \n",
       "48  2.598488e+08  5.652223e+08  4.163416e+09  4.867095e+09  1.400400e+09   \n",
       "49  1.330454e+08  2.424738e+05  2.234599e+07  6.381474e+07  5.664258e+05   \n",
       "\n",
       "            预收账款         所有者权益  \n",
       "0   9.046966e+07  3.612539e+09  \n",
       "1   9.165447e+07  1.069888e+10  \n",
       "2   2.169172e+06  4.234815e+07  \n",
       "3   7.675781e+07  2.355600e+08  \n",
       "4   1.596035e+07  9.485532e+08  \n",
       "5   5.825937e+06  8.037032e+08  \n",
       "6   1.793280e+08  9.892258e+08  \n",
       "7   3.428491e+07  1.733129e+08  \n",
       "8   8.370922e+06  2.924533e+09  \n",
       "9   2.231678e+06  1.070842e+08  \n",
       "10  3.740990e+06  3.606994e+08  \n",
       "11  1.119852e+08  4.949125e+08  \n",
       "12  5.795724e+06  2.925617e+09  \n",
       "13  1.249013e+08  6.618560e+08  \n",
       "14  1.457894e+07  3.880503e+09  \n",
       "15  7.893200e+09  1.677127e+10  \n",
       "16  4.391573e+07  4.826938e+08  \n",
       "17  5.915657e+07  4.025950e+09  \n",
       "18  2.844161e+07  1.699315e+09  \n",
       "19  7.670975e+05  1.516091e+08  \n",
       "20  4.407797e+08  5.265749e+09  \n",
       "21  4.384641e+07  3.575646e+08  \n",
       "22  1.763854e+07  1.536583e+09  \n",
       "23  5.439584e+06  6.852536e+08  \n",
       "24  4.719977e+06  4.868703e+08  \n",
       "25  2.772175e+07  1.176022e+09  \n",
       "26  2.448511e+06  2.363780e+09  \n",
       "27  1.912615e+08  4.226243e+09  \n",
       "28  9.126765e+07  9.673058e+08  \n",
       "29  4.623591e+06  1.070768e+09  \n",
       "30  1.765884e+09  7.511454e+08  \n",
       "31  1.225246e+05  1.135074e+09  \n",
       "32  2.414178e+07  2.636843e+09  \n",
       "33  5.016413e+07  3.671959e+08  \n",
       "34  1.427714e+07  9.752162e+08  \n",
       "35  7.672079e+07  1.001736e+09  \n",
       "36           NaN  7.614756e+09  \n",
       "37  2.811395e+07  3.680930e+08  \n",
       "38  7.986374e+07  2.420108e+09  \n",
       "39  9.026646e+06  2.924752e+08  \n",
       "40  3.799934e+06 -2.087512e+08  \n",
       "41  2.937489e+06  3.854739e+08  \n",
       "42  1.466495e+07  2.368183e+09  \n",
       "43  9.053150e+07  8.516332e+08  \n",
       "44           NaN  1.996090e+10  \n",
       "45  4.390048e+05  2.591748e+08  \n",
       "46  4.026336e+06 -3.934142e+06  \n",
       "47  6.932595e+06  1.155976e+09  \n",
       "48  1.623544e+08  4.845175e+09  \n",
       "49  8.102667e+05  5.364489e+08  "
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_zcfz_df(zcfz_api, code2name_dict=zcfz_code2name_dict)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "15d51d37-de8a-45c2-affd-b2ed74913cfe",
   "metadata": {},
   "source": [
    "## 观察很重要"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f740daf5-f92b-4ef5-bdec-3759a283213a",
   "metadata": {},
   "outputs": [],
   "source": [
    "zcfz_api = 'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "'pageSize=50&pageNumber=1&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "'(REPORT_DATE%3D%272018-06-30%27)'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "7a33d439-4983-4aa4-9936-3cd48a7742b4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&pageSize=50&pageNumber=1&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")(REPORT_DATE%3D%272018-06-30%27)'"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pageSize = 50\n",
    "pageNumber = 1\n",
    "REPORT_DATE = '2018-06-30'\n",
    "zcfz_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'\n",
    "zcfz_api"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "80029098-c116-4899-8377-5a45eea0e16a",
   "metadata": {
    "tags": []
   },
   "source": [
    "### 调整pageSize"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6add4da5-603c-410c-a8c8-28ffd0780bac",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageSize = 500  # 上限是500\n",
    "pageNumber = 1\n",
    "REPORT_DATE = '2018-06-30'\n",
    "zcfz_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "eed7f68a-045a-4897-ab9f-9c46ea80c137",
   "metadata": {},
   "outputs": [],
   "source": [
    "get_zcfz_df(zcfz_api, code2name_dict=zcfz_code2name_dict)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2c0ec9e2-1b55-4741-8ab9-fea75241e0f2",
   "metadata": {},
   "source": [
    "### 不断调整pageNum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "dbb73704-70d7-4b1d-b972-3f177c5eafad",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageSize = 500  # 上限是500\n",
    "pageNumber = 8  # 2018年时上限是8\n",
    "REPORT_DATE = '2018-06-30'\n",
    "zcfz_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "1fa610f7-edd4-4972-8425-ee2ecc3c144e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票代码</th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>公告日期</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>300105.SZ</td>\n",
       "      <td>龙源技术</td>\n",
       "      <td>电源设备</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.233862e+09</td>\n",
       "      <td>1.507404e+08</td>\n",
       "      <td>3.198596e+08</td>\n",
       "      <td>4.363248e+08</td>\n",
       "      <td>1.797683e+08</td>\n",
       "      <td>2.960504e+08</td>\n",
       "      <td>1.438196e+08</td>\n",
       "      <td>5.526434e+07</td>\n",
       "      <td>1.937811e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>300094.SZ</td>\n",
       "      <td>国联水产</td>\n",
       "      <td>食品饮料</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.207269e+09</td>\n",
       "      <td>3.840040e+08</td>\n",
       "      <td>2.606931e+08</td>\n",
       "      <td>7.600013e+08</td>\n",
       "      <td>1.996505e+09</td>\n",
       "      <td>2.098277e+09</td>\n",
       "      <td>1.900299e+08</td>\n",
       "      <td>4.903737e+07</td>\n",
       "      <td>2.108992e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>300081.SZ</td>\n",
       "      <td>恒信东方</td>\n",
       "      <td>通信服务</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>2.616292e+09</td>\n",
       "      <td>3.691971e+07</td>\n",
       "      <td>8.041850e+08</td>\n",
       "      <td>2.576536e+08</td>\n",
       "      <td>2.110814e+08</td>\n",
       "      <td>1.802388e+08</td>\n",
       "      <td>7.161027e+07</td>\n",
       "      <td>6.394335e+06</td>\n",
       "      <td>2.436053e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>300058.SZ</td>\n",
       "      <td>蓝色光标</td>\n",
       "      <td>文化传媒</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.692816e+10</td>\n",
       "      <td>1.178640e+08</td>\n",
       "      <td>1.242228e+09</td>\n",
       "      <td>6.472749e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.052914e+10</td>\n",
       "      <td>3.596262e+09</td>\n",
       "      <td>6.300965e+08</td>\n",
       "      <td>6.399019e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002912.SZ</td>\n",
       "      <td>中新赛克</td>\n",
       "      <td>互联网服务</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.668935e+09</td>\n",
       "      <td>5.886304e+07</td>\n",
       "      <td>8.525062e+08</td>\n",
       "      <td>1.794191e+08</td>\n",
       "      <td>2.591202e+08</td>\n",
       "      <td>5.177192e+08</td>\n",
       "      <td>7.539904e+07</td>\n",
       "      <td>3.355321e+08</td>\n",
       "      <td>1.151216e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>357</th>\n",
       "      <td>603199.SH</td>\n",
       "      <td>九华旅游</td>\n",
       "      <td>旅游酒店</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.218335e+09</td>\n",
       "      <td>6.265929e+08</td>\n",
       "      <td>5.870210e+07</td>\n",
       "      <td>1.743774e+07</td>\n",
       "      <td>5.827042e+06</td>\n",
       "      <td>1.501453e+08</td>\n",
       "      <td>3.899491e+07</td>\n",
       "      <td>6.136427e+06</td>\n",
       "      <td>1.068189e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>358</th>\n",
       "      <td>603713.SH</td>\n",
       "      <td>密尔克卫</td>\n",
       "      <td>物流行业</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.192818e+09</td>\n",
       "      <td>1.059911e+08</td>\n",
       "      <td>9.530315e+07</td>\n",
       "      <td>4.309494e+08</td>\n",
       "      <td>2.259453e+07</td>\n",
       "      <td>3.803581e+08</td>\n",
       "      <td>1.995526e+08</td>\n",
       "      <td>3.390742e+06</td>\n",
       "      <td>8.124597e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>359</th>\n",
       "      <td>002462.SZ</td>\n",
       "      <td>嘉事堂</td>\n",
       "      <td>医药商业</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>1.066171e+10</td>\n",
       "      <td>3.355537e+08</td>\n",
       "      <td>1.390606e+09</td>\n",
       "      <td>5.995777e+09</td>\n",
       "      <td>1.599565e+09</td>\n",
       "      <td>7.191068e+09</td>\n",
       "      <td>2.858789e+09</td>\n",
       "      <td>1.283003e+08</td>\n",
       "      <td>3.470639e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>360</th>\n",
       "      <td>002565.SZ</td>\n",
       "      <td>顺灏股份</td>\n",
       "      <td>包装材料</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>3.948272e+09</td>\n",
       "      <td>6.068767e+08</td>\n",
       "      <td>5.090348e+08</td>\n",
       "      <td>5.477976e+08</td>\n",
       "      <td>6.481708e+08</td>\n",
       "      <td>1.364892e+09</td>\n",
       "      <td>3.006833e+08</td>\n",
       "      <td>2.535495e+07</td>\n",
       "      <td>2.583380e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>361</th>\n",
       "      <td>000818.SZ</td>\n",
       "      <td>航锦科技</td>\n",
       "      <td>化学原料</td>\n",
       "      <td>2018-06-30 00:00:00</td>\n",
       "      <td>4.004898e+09</td>\n",
       "      <td>1.346295e+09</td>\n",
       "      <td>8.573440e+07</td>\n",
       "      <td>3.120088e+08</td>\n",
       "      <td>2.252808e+08</td>\n",
       "      <td>1.252249e+09</td>\n",
       "      <td>3.214217e+08</td>\n",
       "      <td>5.163379e+07</td>\n",
       "      <td>2.752650e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>362 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          股票代码  股票简称   行业名称                 公告日期           总资产          固定资产  \\\n",
       "0    300105.SZ  龙源技术   电源设备  2018-06-30 00:00:00  2.233862e+09  1.507404e+08   \n",
       "1    300094.SZ  国联水产   食品饮料  2018-06-30 00:00:00  4.207269e+09  3.840040e+08   \n",
       "2    300081.SZ  恒信东方   通信服务  2018-06-30 00:00:00  2.616292e+09  3.691971e+07   \n",
       "3    300058.SZ  蓝色光标   文化传媒  2018-06-30 00:00:00  1.692816e+10  1.178640e+08   \n",
       "4    002912.SZ  中新赛克  互联网服务  2018-06-30 00:00:00  1.668935e+09  5.886304e+07   \n",
       "..         ...   ...    ...                  ...           ...           ...   \n",
       "357  603199.SH  九华旅游   旅游酒店  2018-06-30 00:00:00  1.218335e+09  6.265929e+08   \n",
       "358  603713.SH  密尔克卫   物流行业  2018-06-30 00:00:00  1.192818e+09  1.059911e+08   \n",
       "359  002462.SZ   嘉事堂   医药商业  2018-06-30 00:00:00  1.066171e+10  3.355537e+08   \n",
       "360  002565.SZ  顺灏股份   包装材料  2018-06-30 00:00:00  3.948272e+09  6.068767e+08   \n",
       "361  000818.SZ  航锦科技   化学原料  2018-06-30 00:00:00  4.004898e+09  1.346295e+09   \n",
       "\n",
       "             货币资金          应收账款            存货           总负债          应付账款  \\\n",
       "0    3.198596e+08  4.363248e+08  1.797683e+08  2.960504e+08  1.438196e+08   \n",
       "1    2.606931e+08  7.600013e+08  1.996505e+09  2.098277e+09  1.900299e+08   \n",
       "2    8.041850e+08  2.576536e+08  2.110814e+08  1.802388e+08  7.161027e+07   \n",
       "3    1.242228e+09  6.472749e+09           NaN  1.052914e+10  3.596262e+09   \n",
       "4    8.525062e+08  1.794191e+08  2.591202e+08  5.177192e+08  7.539904e+07   \n",
       "..            ...           ...           ...           ...           ...   \n",
       "357  5.870210e+07  1.743774e+07  5.827042e+06  1.501453e+08  3.899491e+07   \n",
       "358  9.530315e+07  4.309494e+08  2.259453e+07  3.803581e+08  1.995526e+08   \n",
       "359  1.390606e+09  5.995777e+09  1.599565e+09  7.191068e+09  2.858789e+09   \n",
       "360  5.090348e+08  5.477976e+08  6.481708e+08  1.364892e+09  3.006833e+08   \n",
       "361  8.573440e+07  3.120088e+08  2.252808e+08  1.252249e+09  3.214217e+08   \n",
       "\n",
       "             预收账款         所有者权益  \n",
       "0    5.526434e+07  1.937811e+09  \n",
       "1    4.903737e+07  2.108992e+09  \n",
       "2    6.394335e+06  2.436053e+09  \n",
       "3    6.300965e+08  6.399019e+09  \n",
       "4    3.355321e+08  1.151216e+09  \n",
       "..            ...           ...  \n",
       "357  6.136427e+06  1.068189e+09  \n",
       "358  3.390742e+06  8.124597e+08  \n",
       "359  1.283003e+08  3.470639e+09  \n",
       "360  2.535495e+07  2.583380e+09  \n",
       "361  5.163379e+07  2.752650e+09  \n",
       "\n",
       "[362 rows x 13 columns]"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_zcfz_df(zcfz_api, code2name_dict=zcfz_code2name_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3bb925f9-47b7-405c-b1d9-e2210b667ab1",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageSize = 500  # 上限是500\n",
    "pageNumber = 9  # 2018年时上限是8\n",
    "REPORT_DATE = '2018-06-30'\n",
    "zcfz_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'\n",
    "json.loads(requests.get(zcfz_api).text)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d28b3fed-860e-4b3f-bd7b-2dfa8ecdbc3b",
   "metadata": {},
   "source": [
    "### 确定循环范围"
   ]
  },
  {
   "cell_type": "raw",
   "id": "324f36f8-c545-4663-951a-a3606185ecf7",
   "metadata": {},
   "source": [
    "（1）一季报：4月底要公布完毕。\n",
    "（2）半年报：7月起至8月底公布完毕。\n",
    "（3）三季报：10月底公布完毕。\n",
    "（4）年报：明年1月中旬起至4月底要公布完毕"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "id": "ac2963f9-30ae-431a-8376-799d69a765df",
   "metadata": {},
   "outputs": [],
   "source": [
    "report_date_list = ['2017-12-31', '2018-12-31', '2019-12-31', '2020-12-31', '2021-12-31']\n",
    "pageSize = 500\n",
    "pageNumber_list = range(20) # 不会超过20了"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a5cfa3b8-8c95-4d43-8e53-ac337d1066b4",
   "metadata": {},
   "source": [
    "## 异常抛出和等待"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "499a5389-acc5-4d3d-ae76-8495b49143cb",
   "metadata": {},
   "source": [
    "### 暴力的方式：报错捕获跳过"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a49a9fd4-148b-48db-a148-476ed25ed281",
   "metadata": {},
   "source": [
    "Python的异常处理：https://www.runoob.com/python3/python3-errors-execptions.html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "7f17d799-19e6-4bbc-8844-7d0eaa22fe15",
   "metadata": {},
   "outputs": [],
   "source": [
    "pageSize = 500  # 上限是500\n",
    "pageNumber = 9  # 2018年时上限是8\n",
    "REPORT_DATE = '2018-06-30'\n",
    "zcfz_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "e9e27d2e-51ed-483c-9262-7ceea36adfb5",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'NoneType' object is not subscriptable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_21112/115904730.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mget_zcfz_df\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mzcfz_api\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcode2name_dict\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mzcfz_code2name_dict\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_21112/1941394750.py\u001b[0m in \u001b[0;36mget_zcfz_df\u001b[1;34m(api, code2name_dict)\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mget_zcfz_df\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mapi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcode2name_dict\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m     \u001b[0mzcfz_df\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mjson\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloads\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mrequests\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mapi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'result'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'data'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      3\u001b[0m     \u001b[0mzcfz_df\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mzcfz_df\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcode2name_dict\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[0mzcfz_df\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mzcfz_df\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrename\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcode2name_dict\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mzcfz_df\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'NoneType' object is not subscriptable"
     ]
    }
   ],
   "source": [
    "get_zcfz_df(zcfz_api, code2name_dict=zcfz_code2name_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "1b743cd2-ea78-41de-981b-92ed82ddd399",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9 当前页码无数据\n"
     ]
    }
   ],
   "source": [
    "for i in range(1, 100):\n",
    "    pageSize = 500  # 上限是500\n",
    "    pageNumber = i  # 2018年时上限是8\n",
    "    REPORT_DATE = '2018-06-30'\n",
    "    zcfz_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "    f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "    f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'\n",
    "    try:\n",
    "        get_zcfz_df(zcfz_api, code2name_dict=zcfz_code2name_dict)\n",
    "    except Exception as e:\n",
    "        print(i, '当前页码无数据')\n",
    "        break"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8739a00c-5cef-45b4-9e75-8aec58e94277",
   "metadata": {},
   "source": [
    "### 更优雅的方式：更新函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "24a5d040-a98b-4655-baef-198b119a89d9",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'NoneType' object is not subscriptable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_21112/1241664850.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mjson\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloads\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mrequests\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mzcfz_api\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'result'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'data'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: 'NoneType' object is not subscriptable"
     ]
    }
   ],
   "source": [
    "json.loads(requests.get(zcfz_api).text)['result']['data']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "c49bb645-ddfd-451a-a3b4-0efd9eb68799",
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_zcfz_df_v2(api, code2name_dict):\n",
    "    res = json.loads(requests.get(api).text)['result']\n",
    "    if res==None:  # 如果为空就不解析了\n",
    "        return pd.DataFrame([])\n",
    "    zcfz_df = pd.DataFrame(res['data'])\n",
    "    zcfz_df = zcfz_df.loc[:, code2name_dict]\n",
    "    zcfz_df = zcfz_df.rename(columns=code2name_dict)\n",
    "    return zcfz_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "bade15e4-75d7-4430-9406-13213e836da6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 0)"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame([]).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "id": "47c5ea52-7f06-4537-b76c-aea69b5c5ad0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9 当前页码无数据\n"
     ]
    }
   ],
   "source": [
    "for i in range(1, 100):\n",
    "    pageSize = 500  # 上限是500\n",
    "    pageNumber = i  # 2018年时上限是8\n",
    "    REPORT_DATE = '2018-06-30'\n",
    "    zcfz_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "    f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "    f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'\n",
    "    zcfz_df = get_zcfz_df_v2(zcfz_api, code2name_dict=zcfz_code2name_dict)\n",
    "    if zcfz_df.shape[0] == 0:\n",
    "        print(i, '当前页码无数据')\n",
    "        break"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bc58f604-879c-4f7f-b89f-bdbbafd2c9a1",
   "metadata": {},
   "source": [
    "### 必要的等待：time.sleep"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb2dbe18-c370-42c0-b52a-ea29cbec4f40",
   "metadata": {},
   "source": [
    "防止爬的太快把你断掉了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "id": "06552fb3-b832-4aa6-bf31-653dd3737a34",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "e4f09cd2-73a0-4c0e-9c1a-6cc5ba2d06f3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n",
      "5\n",
      "6\n",
      "7\n",
      "8\n",
      "9\n"
     ]
    }
   ],
   "source": [
    "for i in range(10):\n",
    "    print(i)\n",
    "    time.sleep(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ee4e235a-0e11-40b3-a29a-a921c2f16fc5",
   "metadata": {},
   "source": [
    "## 整合代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "f9386138-a729-487d-8fff-e25ddf35932e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "import requests\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "id": "22f0048e-c6e4-485b-bd10-20b5152428bd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 结合网址去查看\n",
    "zcfz_name2code_dict = {\n",
    "    '股票代码': 'SECUCODE'\n",
    "    ,'股票简称': 'SECURITY_NAME_ABBR'\n",
    "    ,'行业名称': 'INDUSTRY_NAME'\n",
    "    ,'公告日期': 'REPORT_DATE'\n",
    "    ,'总资产': 'TOTAL_ASSETS'\n",
    "    ,'固定资产': 'FIXED_ASSET'\n",
    "    ,'货币资金': 'MONETARYFUNDS'\n",
    "    ,'应收账款': 'ACCOUNTS_RECE'\n",
    "    ,'存货': 'INVENTORY'\n",
    "    ,'总负债': 'TOTAL_LIABILITIES'\n",
    "    ,'应付账款': 'ACCOUNTS_PAYABLE'\n",
    "    ,'预收账款': 'ADVANCE_RECEIVABLES'\n",
    "    ,'所有者权益': 'TOTAL_EQUITY'\n",
    "}\n",
    "zcfz_code2name_dict = {v:k for k,v in zcfz_name2code_dict.items()}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "a7562cb3-7d45-40c3-8214-fef4689dfc54",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 结合网址去查看\n",
    "lrb_name2code_dict = {\n",
    "    '股票代码': 'SECUCODE'\n",
    "    ,'股票简称': 'SECURITY_NAME_ABBR'\n",
    "    ,'行业名称': 'INDUSTRY_NAME'\n",
    "    ,'公告日期': 'REPORT_DATE'\n",
    "    ,'营业收入': 'TOTAL_OPERATE_INCOME'\n",
    "    ,'营业成本': 'OPERATE_COST'\n",
    "    ,'销售费用': 'SALE_EXPENSE'\n",
    "    ,'管理费用': 'MANAGE_EXPENSE'\n",
    "    ,'财务费用': 'FINANCE_EXPENSE'\n",
    "    ,'营业总支出': 'TOTAL_OPERATE_COST'\n",
    "    ,'营业利润': 'OPERATE_PROFIT'\n",
    "    ,'利润总额': 'TOTAL_PROFIT'\n",
    "    ,'所得税费用': 'INCOME_TAX'\n",
    "    ,'净利润': 'OPERATE_INCOME'\n",
    "}\n",
    "lrb_code2name_dict = {v:k for k,v in lrb_name2code_dict.items()}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "24cb2e5c-fa1e-4ce9-8f05-0c68e4693308",
   "metadata": {},
   "outputs": [],
   "source": [
    "report_date_list = ['2017-12-31', '2018-12-31', '2019-12-31', '2020-12-31', '2021-12-31']\n",
    "pageSize = 500\n",
    "pageNumber_list = range(20) # 不会超过20了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "c9d0f488-20ac-4719-94af-9665b4d12b10",
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_zcfz_df_v2(api, code2name_dict):\n",
    "    res = json.loads(requests.get(api).text)['result']\n",
    "    if res==None:  # 如果为空就不解析了\n",
    "        return pd.DataFrame([])\n",
    "    zcfz_df = pd.DataFrame(res['data'])\n",
    "    zcfz_df = zcfz_df.loc[:, code2name_dict]\n",
    "    zcfz_df = zcfz_df.rename(columns=code2name_dict)\n",
    "    return zcfz_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "5652b48d-0aea-4471-8deb-9093255e45ae",
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_lrb_df_v2(api, code2name_dict):\n",
    "    res = json.loads(requests.get(api).text)['result']\n",
    "    if res==None:  # 如果为空就不解析了\n",
    "        return pd.DataFrame([])        \n",
    "    lrb_df = pd.DataFrame(res['data'])\n",
    "    lrb_df = lrb_df.loc[:, code2name_dict]\n",
    "    lrb_df = lrb_df.rename(columns=code2name_dict)\n",
    "    return lrb_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "71e58479-37ad-4149-a315-b33ac4dfde82",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "开始获取 2017-12-31\n",
      "开始获取 2018-12-31\n",
      "开始获取 2019-12-31\n",
      "开始获取 2020-12-31\n",
      "开始获取 2021-12-31\n"
     ]
    }
   ],
   "source": [
    "total_zcfz_df = pd.DataFrame([])\n",
    "for REPORT_DATE in report_date_list:\n",
    "    print('开始获取', REPORT_DATE)\n",
    "    for pageNumber in pageNumber_list:\n",
    "            zcfz_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?&sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "    f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_BALANCE&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(\"058001001\"%2C\"058001008\"))(TRADE_MARKET_CODE!%3D\"069001017\")'\\\n",
    "    f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'\n",
    "            tmp_zcfz_df = get_zcfz_df_v2(zcfz_api, code2name_dict=zcfz_code2name_dict)\n",
    "            if tmp_zcfz_df.shape[0] == 0:\n",
    "                break\n",
    "            else:\n",
    "                if total_zcfz_df.shape[0] == 0:\n",
    "                    total_zcfz_df = tmp_zcfz_df\n",
    "                else:\n",
    "                    total_zcfz_df = pd.concat([total_zcfz_df, tmp_zcfz_df], axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "id": "c06fd1fa-dfe9-422b-b09d-524294855c8e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(26879, 13)"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "id": "d92ca262-34c2-4c7c-ac2c-9f1a694d9bdb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "开始获取 2017-12-31\n",
      "开始获取 2018-12-31\n",
      "开始获取 2019-12-31\n",
      "开始获取 2020-12-31\n",
      "开始获取 2021-12-31\n"
     ]
    }
   ],
   "source": [
    "total_lrb_df = pd.DataFrame([])\n",
    "for REPORT_DATE in report_date_list:\n",
    "    print('开始获取', REPORT_DATE)\n",
    "    for pageNumber in pageNumber_list:\n",
    "            lrb_api = f'https://datacenter-web.eastmoney.com/api/data/v1/get?sortColumns=NOTICE_DATE%2CSECURITY_CODE&sortTypes=-1%2C-1&'\\\n",
    "f'pageSize={pageSize}&pageNumber={pageNumber}&reportName=RPT_DMSK_FN_INCOME&columns=ALL&filter=(SECURITY_TYPE_CODE+in+(%22058001001%22%2C%22058001008%22))(TRADE_MARKET_CODE!%3D%22069001017%22)'\\\n",
    "f'(REPORT_DATE%3D%27{REPORT_DATE}%27)'\n",
    "            tmp_lrb_df = get_lrb_df_v2(lrb_api, code2name_dict=lrb_code2name_dict)\n",
    "            if tmp_lrb_df.shape[0] == 0:\n",
    "                break\n",
    "            else:\n",
    "                if tmp_lrb_df.shape[0] == 0:\n",
    "                    total_lrb_df = tmp_lrb_df\n",
    "                else:\n",
    "                    total_lrb_df = pd.concat([total_lrb_df, tmp_lrb_df], axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "id": "6750e21d-9f67-41b5-a459-67da64c3bd38",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(26906, 14)"
      ]
     },
     "execution_count": 110,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_lrb_df.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7c8b0b7c-094d-4ccc-8020-900e2228750f",
   "metadata": {},
   "source": [
    "# 杜邦分析法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "id": "22b37bc6-3dbd-4aa0-8e7d-8f017cbc1db8",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票代码</th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>公告日期</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002396.SZ</td>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>6.439913e+09</td>\n",
       "      <td>4.844548e+08</td>\n",
       "      <td>1.731688e+09</td>\n",
       "      <td>1.521677e+09</td>\n",
       "      <td>1.362966e+09</td>\n",
       "      <td>2.690476e+09</td>\n",
       "      <td>9.378150e+08</td>\n",
       "      <td>6.744459e+07</td>\n",
       "      <td>3.749436e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002237.SZ</td>\n",
       "      <td>恒邦股份</td>\n",
       "      <td>贵金属</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>1.343417e+10</td>\n",
       "      <td>3.613943e+09</td>\n",
       "      <td>1.317289e+09</td>\n",
       "      <td>1.253392e+07</td>\n",
       "      <td>4.846801e+09</td>\n",
       "      <td>8.876205e+09</td>\n",
       "      <td>1.556165e+09</td>\n",
       "      <td>3.274219e+08</td>\n",
       "      <td>4.557968e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>000820.SZ</td>\n",
       "      <td>神雾节能</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>2.550938e+09</td>\n",
       "      <td>9.861318e+06</td>\n",
       "      <td>4.441687e+08</td>\n",
       "      <td>4.164500e+08</td>\n",
       "      <td>2.939347e+08</td>\n",
       "      <td>1.836391e+09</td>\n",
       "      <td>3.333251e+08</td>\n",
       "      <td>8.190880e+07</td>\n",
       "      <td>7.145473e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002776.SZ</td>\n",
       "      <td>ST柏龙</td>\n",
       "      <td>纺织服装</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>2.561272e+09</td>\n",
       "      <td>1.512387e+08</td>\n",
       "      <td>1.247969e+09</td>\n",
       "      <td>1.461103e+08</td>\n",
       "      <td>1.060385e+08</td>\n",
       "      <td>6.506575e+08</td>\n",
       "      <td>4.251079e+07</td>\n",
       "      <td>3.698023e+06</td>\n",
       "      <td>1.910615e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>600748.SH</td>\n",
       "      <td>上实发展</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>3.869392e+10</td>\n",
       "      <td>9.757817e+07</td>\n",
       "      <td>9.410630e+09</td>\n",
       "      <td>1.383166e+09</td>\n",
       "      <td>1.942242e+10</td>\n",
       "      <td>2.756497e+10</td>\n",
       "      <td>1.212087e+09</td>\n",
       "      <td>8.353998e+09</td>\n",
       "      <td>1.112895e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>374</th>\n",
       "      <td>300325.SZ</td>\n",
       "      <td>德威退</td>\n",
       "      <td>塑料制品</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>2.515615e+09</td>\n",
       "      <td>5.103316e+08</td>\n",
       "      <td>1.712263e+08</td>\n",
       "      <td>1.276471e+08</td>\n",
       "      <td>1.635077e+08</td>\n",
       "      <td>2.829299e+09</td>\n",
       "      <td>8.564501e+07</td>\n",
       "      <td>5.793591e+07</td>\n",
       "      <td>-3.136841e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>375</th>\n",
       "      <td>002770.SZ</td>\n",
       "      <td>科迪退</td>\n",
       "      <td>食品饮料</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>2.414398e+09</td>\n",
       "      <td>1.175702e+09</td>\n",
       "      <td>1.801607e+07</td>\n",
       "      <td>7.795656e+06</td>\n",
       "      <td>5.443509e+07</td>\n",
       "      <td>2.241976e+09</td>\n",
       "      <td>2.019216e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.724227e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>376</th>\n",
       "      <td>002260.SZ</td>\n",
       "      <td>德奥退</td>\n",
       "      <td>家电行业</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>8.372433e+08</td>\n",
       "      <td>8.415270e+07</td>\n",
       "      <td>2.436602e+08</td>\n",
       "      <td>9.243759e+07</td>\n",
       "      <td>5.084700e+07</td>\n",
       "      <td>6.770779e+08</td>\n",
       "      <td>6.709732e+07</td>\n",
       "      <td>3.693987e+06</td>\n",
       "      <td>1.601655e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>377</th>\n",
       "      <td>300178.SZ</td>\n",
       "      <td>腾邦退</td>\n",
       "      <td>旅游酒店</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>4.169976e+09</td>\n",
       "      <td>2.082842e+08</td>\n",
       "      <td>8.016624e+07</td>\n",
       "      <td>1.193530e+08</td>\n",
       "      <td>3.480466e+07</td>\n",
       "      <td>5.518111e+09</td>\n",
       "      <td>2.619102e+08</td>\n",
       "      <td>6.411086e+07</td>\n",
       "      <td>-1.348135e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>378</th>\n",
       "      <td>300201.SZ</td>\n",
       "      <td>*ST海伦</td>\n",
       "      <td>工程机械</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>2.329837e+09</td>\n",
       "      <td>3.585854e+08</td>\n",
       "      <td>2.539929e+08</td>\n",
       "      <td>7.116661e+08</td>\n",
       "      <td>2.169490e+08</td>\n",
       "      <td>1.042089e+09</td>\n",
       "      <td>5.877885e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.287748e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>26879 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          股票代码   股票简称   行业名称                 公告日期           总资产          固定资产  \\\n",
       "0    002396.SZ   星网锐捷   通信设备  2017-12-31 00:00:00  6.439913e+09  4.844548e+08   \n",
       "1    002237.SZ   恒邦股份    贵金属  2017-12-31 00:00:00  1.343417e+10  3.613943e+09   \n",
       "2    000820.SZ   神雾节能   环保行业  2017-12-31 00:00:00  2.550938e+09  9.861318e+06   \n",
       "3    002776.SZ   ST柏龙   纺织服装  2017-12-31 00:00:00  2.561272e+09  1.512387e+08   \n",
       "4    600748.SH   上实发展  房地产开发  2017-12-31 00:00:00  3.869392e+10  9.757817e+07   \n",
       "..         ...    ...    ...                  ...           ...           ...   \n",
       "374  300325.SZ    德威退   塑料制品  2021-12-31 00:00:00  2.515615e+09  5.103316e+08   \n",
       "375  002770.SZ    科迪退   食品饮料  2021-12-31 00:00:00  2.414398e+09  1.175702e+09   \n",
       "376  002260.SZ    德奥退   家电行业  2021-12-31 00:00:00  8.372433e+08  8.415270e+07   \n",
       "377  300178.SZ    腾邦退   旅游酒店  2021-12-31 00:00:00  4.169976e+09  2.082842e+08   \n",
       "378  300201.SZ  *ST海伦   工程机械  2021-12-31 00:00:00  2.329837e+09  3.585854e+08   \n",
       "\n",
       "             货币资金          应收账款            存货           总负债          应付账款  \\\n",
       "0    1.731688e+09  1.521677e+09  1.362966e+09  2.690476e+09  9.378150e+08   \n",
       "1    1.317289e+09  1.253392e+07  4.846801e+09  8.876205e+09  1.556165e+09   \n",
       "2    4.441687e+08  4.164500e+08  2.939347e+08  1.836391e+09  3.333251e+08   \n",
       "3    1.247969e+09  1.461103e+08  1.060385e+08  6.506575e+08  4.251079e+07   \n",
       "4    9.410630e+09  1.383166e+09  1.942242e+10  2.756497e+10  1.212087e+09   \n",
       "..            ...           ...           ...           ...           ...   \n",
       "374  1.712263e+08  1.276471e+08  1.635077e+08  2.829299e+09  8.564501e+07   \n",
       "375  1.801607e+07  7.795656e+06  5.443509e+07  2.241976e+09  2.019216e+08   \n",
       "376  2.436602e+08  9.243759e+07  5.084700e+07  6.770779e+08  6.709732e+07   \n",
       "377  8.016624e+07  1.193530e+08  3.480466e+07  5.518111e+09  2.619102e+08   \n",
       "378  2.539929e+08  7.116661e+08  2.169490e+08  1.042089e+09  5.877885e+08   \n",
       "\n",
       "             预收账款         所有者权益  \n",
       "0    6.744459e+07  3.749436e+09  \n",
       "1    3.274219e+08  4.557968e+09  \n",
       "2    8.190880e+07  7.145473e+08  \n",
       "3    3.698023e+06  1.910615e+09  \n",
       "4    8.353998e+09  1.112895e+10  \n",
       "..            ...           ...  \n",
       "374  5.793591e+07 -3.136841e+08  \n",
       "375           NaN  1.724227e+08  \n",
       "376  3.693987e+06  1.601655e+08  \n",
       "377  6.411086e+07 -1.348135e+09  \n",
       "378           NaN  1.287748e+09  \n",
       "\n",
       "[26879 rows x 13 columns]"
      ]
     },
     "execution_count": 112,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "id": "3a787240-cc6e-42d6-acc8-8de193370b83",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票代码</th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>公告日期</th>\n",
       "      <th>营业收入</th>\n",
       "      <th>营业成本</th>\n",
       "      <th>销售费用</th>\n",
       "      <th>管理费用</th>\n",
       "      <th>财务费用</th>\n",
       "      <th>营业总支出</th>\n",
       "      <th>营业利润</th>\n",
       "      <th>利润总额</th>\n",
       "      <th>所得税费用</th>\n",
       "      <th>净利润</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002396.SZ</td>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>7.705136e+09</td>\n",
       "      <td>4.744432e+09</td>\n",
       "      <td>1.269197e+09</td>\n",
       "      <td>2.207531e+08</td>\n",
       "      <td>1.181273e+07</td>\n",
       "      <td>7.310361e+09</td>\n",
       "      <td>7.350730e+08</td>\n",
       "      <td>7.420438e+08</td>\n",
       "      <td>4.605915e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002237.SZ</td>\n",
       "      <td>恒邦股份</td>\n",
       "      <td>贵金属</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>1.977557e+10</td>\n",
       "      <td>1.824637e+10</td>\n",
       "      <td>1.087449e+08</td>\n",
       "      <td>4.234824e+08</td>\n",
       "      <td>2.802913e+08</td>\n",
       "      <td>1.918515e+10</td>\n",
       "      <td>4.913524e+08</td>\n",
       "      <td>4.775052e+08</td>\n",
       "      <td>8.350815e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>000820.SZ</td>\n",
       "      <td>神雾节能</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>8.602532e+08</td>\n",
       "      <td>4.352699e+08</td>\n",
       "      <td>1.597203e+07</td>\n",
       "      <td>8.855253e+07</td>\n",
       "      <td>1.713613e+07</td>\n",
       "      <td>7.255664e+08</td>\n",
       "      <td>1.338334e+08</td>\n",
       "      <td>1.418170e+08</td>\n",
       "      <td>4.350101e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002776.SZ</td>\n",
       "      <td>ST柏龙</td>\n",
       "      <td>纺织服装</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>5.982642e+08</td>\n",
       "      <td>4.323342e+08</td>\n",
       "      <td>3.459928e+07</td>\n",
       "      <td>5.562735e+07</td>\n",
       "      <td>4.298285e+06</td>\n",
       "      <td>5.324685e+08</td>\n",
       "      <td>7.673908e+07</td>\n",
       "      <td>7.672014e+07</td>\n",
       "      <td>1.890867e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>600748.SH</td>\n",
       "      <td>上实发展</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>6.820828e+09</td>\n",
       "      <td>4.625509e+09</td>\n",
       "      <td>2.193115e+08</td>\n",
       "      <td>2.692916e+08</td>\n",
       "      <td>2.301748e+08</td>\n",
       "      <td>6.373211e+09</td>\n",
       "      <td>8.167063e+08</td>\n",
       "      <td>8.470115e+08</td>\n",
       "      <td>2.875447e+08</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>405</th>\n",
       "      <td>300390.SZ</td>\n",
       "      <td>天华超净</td>\n",
       "      <td>能源金属</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>3.397558e+09</td>\n",
       "      <td>1.661473e+09</td>\n",
       "      <td>3.854796e+07</td>\n",
       "      <td>1.432104e+08</td>\n",
       "      <td>3.774768e+07</td>\n",
       "      <td>1.948790e+09</td>\n",
       "      <td>1.469591e+09</td>\n",
       "      <td>1.470582e+09</td>\n",
       "      <td>2.195393e+08</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>406</th>\n",
       "      <td>300708.SZ</td>\n",
       "      <td>聚灿光电</td>\n",
       "      <td>光学光电子</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>2.009197e+09</td>\n",
       "      <td>1.669936e+09</td>\n",
       "      <td>1.040123e+07</td>\n",
       "      <td>3.683446e+07</td>\n",
       "      <td>2.416264e+07</td>\n",
       "      <td>1.848742e+09</td>\n",
       "      <td>1.915223e+08</td>\n",
       "      <td>1.903143e+08</td>\n",
       "      <td>1.323771e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>407</th>\n",
       "      <td>600272.SH</td>\n",
       "      <td>开开实业</td>\n",
       "      <td>医药商业</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>6.698304e+08</td>\n",
       "      <td>4.928612e+08</td>\n",
       "      <td>8.322754e+07</td>\n",
       "      <td>8.631327e+07</td>\n",
       "      <td>5.574895e+06</td>\n",
       "      <td>6.736855e+08</td>\n",
       "      <td>2.572128e+07</td>\n",
       "      <td>2.462762e+07</td>\n",
       "      <td>8.250177e+06</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>408</th>\n",
       "      <td>300803.SZ</td>\n",
       "      <td>指南针</td>\n",
       "      <td>软件开发</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>9.324210e+08</td>\n",
       "      <td>1.108948e+08</td>\n",
       "      <td>5.012724e+08</td>\n",
       "      <td>6.698356e+07</td>\n",
       "      <td>-2.470915e+07</td>\n",
       "      <td>7.689770e+08</td>\n",
       "      <td>1.903426e+08</td>\n",
       "      <td>1.896749e+08</td>\n",
       "      <td>1.347821e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>409</th>\n",
       "      <td>002107.SZ</td>\n",
       "      <td>沃华医药</td>\n",
       "      <td>中药</td>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>9.426746e+08</td>\n",
       "      <td>2.123782e+08</td>\n",
       "      <td>4.218126e+08</td>\n",
       "      <td>5.124635e+07</td>\n",
       "      <td>-8.267994e+05</td>\n",
       "      <td>7.482237e+08</td>\n",
       "      <td>1.926863e+08</td>\n",
       "      <td>1.899557e+08</td>\n",
       "      <td>2.863256e+07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>26906 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          股票代码  股票简称   行业名称                 公告日期          营业收入          营业成本  \\\n",
       "0    002396.SZ  星网锐捷   通信设备  2017-12-31 00:00:00  7.705136e+09  4.744432e+09   \n",
       "1    002237.SZ  恒邦股份    贵金属  2017-12-31 00:00:00  1.977557e+10  1.824637e+10   \n",
       "2    000820.SZ  神雾节能   环保行业  2017-12-31 00:00:00  8.602532e+08  4.352699e+08   \n",
       "3    002776.SZ  ST柏龙   纺织服装  2017-12-31 00:00:00  5.982642e+08  4.323342e+08   \n",
       "4    600748.SH  上实发展  房地产开发  2017-12-31 00:00:00  6.820828e+09  4.625509e+09   \n",
       "..         ...   ...    ...                  ...           ...           ...   \n",
       "405  300390.SZ  天华超净   能源金属  2021-12-31 00:00:00  3.397558e+09  1.661473e+09   \n",
       "406  300708.SZ  聚灿光电  光学光电子  2021-12-31 00:00:00  2.009197e+09  1.669936e+09   \n",
       "407  600272.SH  开开实业   医药商业  2021-12-31 00:00:00  6.698304e+08  4.928612e+08   \n",
       "408  300803.SZ   指南针   软件开发  2021-12-31 00:00:00  9.324210e+08  1.108948e+08   \n",
       "409  002107.SZ  沃华医药     中药  2021-12-31 00:00:00  9.426746e+08  2.123782e+08   \n",
       "\n",
       "             销售费用          管理费用          财务费用         营业总支出          营业利润  \\\n",
       "0    1.269197e+09  2.207531e+08  1.181273e+07  7.310361e+09  7.350730e+08   \n",
       "1    1.087449e+08  4.234824e+08  2.802913e+08  1.918515e+10  4.913524e+08   \n",
       "2    1.597203e+07  8.855253e+07  1.713613e+07  7.255664e+08  1.338334e+08   \n",
       "3    3.459928e+07  5.562735e+07  4.298285e+06  5.324685e+08  7.673908e+07   \n",
       "4    2.193115e+08  2.692916e+08  2.301748e+08  6.373211e+09  8.167063e+08   \n",
       "..            ...           ...           ...           ...           ...   \n",
       "405  3.854796e+07  1.432104e+08  3.774768e+07  1.948790e+09  1.469591e+09   \n",
       "406  1.040123e+07  3.683446e+07  2.416264e+07  1.848742e+09  1.915223e+08   \n",
       "407  8.322754e+07  8.631327e+07  5.574895e+06  6.736855e+08  2.572128e+07   \n",
       "408  5.012724e+08  6.698356e+07 -2.470915e+07  7.689770e+08  1.903426e+08   \n",
       "409  4.218126e+08  5.124635e+07 -8.267994e+05  7.482237e+08  1.926863e+08   \n",
       "\n",
       "             利润总额         所得税费用  净利润  \n",
       "0    7.420438e+08  4.605915e+07  NaN  \n",
       "1    4.775052e+08  8.350815e+07  NaN  \n",
       "2    1.418170e+08  4.350101e+07  NaN  \n",
       "3    7.672014e+07  1.890867e+07  NaN  \n",
       "4    8.470115e+08  2.875447e+08  NaN  \n",
       "..            ...           ...  ...  \n",
       "405  1.470582e+09  2.195393e+08  NaN  \n",
       "406  1.903143e+08  1.323771e+07  NaN  \n",
       "407  2.462762e+07  8.250177e+06  NaN  \n",
       "408  1.896749e+08  1.347821e+07  NaN  \n",
       "409  1.899557e+08  2.863256e+07  NaN  \n",
       "\n",
       "[26906 rows x 14 columns]"
      ]
     },
     "execution_count": 111,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_lrb_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "91beb8e0-40b5-4298-bd47-f62a902ede0e",
   "metadata": {},
   "source": [
    "## 对位计算准备：多重索引构建"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6e2cf255-bc46-4503-973b-3a31e7e22396",
   "metadata": {},
   "source": [
    "### 多重索引的优势"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7465a35c-a7b5-4501-a530-42c2066c381e",
   "metadata": {},
   "source": [
    "利用多重索引计算，能解决单个索引解决不了的问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "id": "6666312b-5f73-4b0e-a0f9-ad600f7f81cc",
   "metadata": {},
   "outputs": [],
   "source": [
    ">>> df1 = pd.DataFrame({'people': ['afan', 'afan', 'stella', 'stella'],\n",
    "...                    'year': [2011, 2012, 2013, 2014],\n",
    "...                    'sale': [55, 40, 84, 31],\n",
    "                      })\n",
    "\n",
    ">>> df2 = pd.DataFrame({'people': ['afan', 'afan', 'stella'],\n",
    "...                    'year': [2011, 2012, 2014],\n",
    "                       'net_income': [20, 10, 10],\n",
    "                      })"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "id": "121d5ded-f065-4e5a-89ff-32ac40ecc89c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>people</th>\n",
       "      <th>year</th>\n",
       "      <th>sale</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>afan</td>\n",
       "      <td>2011</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>afan</td>\n",
       "      <td>2012</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>stella</td>\n",
       "      <td>2013</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>stella</td>\n",
       "      <td>2014</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   people  year  sale\n",
       "0    afan  2011    55\n",
       "1    afan  2012    40\n",
       "2  stella  2013    84\n",
       "3  stella  2014    31"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "id": "cae07aec-e1c0-42bd-880f-2edc05aa2cfb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>people</th>\n",
       "      <th>year</th>\n",
       "      <th>net_income</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>afan</td>\n",
       "      <td>2011</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>afan</td>\n",
       "      <td>2012</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>stella</td>\n",
       "      <td>2014</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   people  year  net_income\n",
       "0    afan  2011          20\n",
       "1    afan  2012          10\n",
       "2  stella  2014          10"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "49e37f60-bba8-4afe-a85f-1ff084f9fa18",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "people\n",
       "afan      55\n",
       "afan      40\n",
       "stella    84\n",
       "stella    31\n",
       "Name: sale, dtype: int64"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.set_index('people')['sale']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "id": "64d3d70d-caa7-40ef-8a96-844914b711b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "people\n",
       "afan      20\n",
       "afan      10\n",
       "stella    10\n",
       "Name: net_income, dtype: int64"
      ]
     },
     "execution_count": 128,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.set_index('people')['net_income']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "id": "91f7debc-f239-470d-9ab1-d87f0623c068",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "people\n",
       "afan      0.363636\n",
       "afan      0.500000\n",
       "afan      0.181818\n",
       "afan      0.250000\n",
       "stella    0.119048\n",
       "stella    0.322581\n",
       "dtype: float64"
      ]
     },
     "execution_count": 130,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> df2.set_index('people')['net_income'] / df1.set_index('people')['sale']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "id": "851cfa3d-cea8-433d-a370-b2efd615aa19",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>sale</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>year</th>\n",
       "      <th>people</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2011</th>\n",
       "      <th>afan</th>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2012</th>\n",
       "      <th>afan</th>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013</th>\n",
       "      <th>stella</th>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014</th>\n",
       "      <th>stella</th>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             sale\n",
       "year people      \n",
       "2011 afan      55\n",
       "2012 afan      40\n",
       "2013 stella    84\n",
       "2014 stella    31"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.set_index(['year', 'people'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "21290193-15b3-414b-9328-7a50fc34790a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "year  people\n",
       "2011  afan      2.75\n",
       "2012  afan      4.00\n",
       "2013  stella     NaN\n",
       "2014  stella    3.10\n",
       "dtype: float64"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " df1.set_index(['year', 'people'])['sale'] /  df2.set_index(['year', 'people'])['net_income']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "28e86179-3d82-4d88-8b7c-d9b09276bfee",
   "metadata": {},
   "source": [
    "### 构建set_index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "608cb8c1-2746-43eb-9122-acb0db912b80",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票代码</th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>公告日期</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002396.SZ</td>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>6.439913e+09</td>\n",
       "      <td>4.844548e+08</td>\n",
       "      <td>1.731688e+09</td>\n",
       "      <td>1.521677e+09</td>\n",
       "      <td>1.362966e+09</td>\n",
       "      <td>2.690476e+09</td>\n",
       "      <td>9.378150e+08</td>\n",
       "      <td>6.744459e+07</td>\n",
       "      <td>3.749436e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002237.SZ</td>\n",
       "      <td>恒邦股份</td>\n",
       "      <td>贵金属</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>1.343417e+10</td>\n",
       "      <td>3.613943e+09</td>\n",
       "      <td>1.317289e+09</td>\n",
       "      <td>1.253392e+07</td>\n",
       "      <td>4.846801e+09</td>\n",
       "      <td>8.876205e+09</td>\n",
       "      <td>1.556165e+09</td>\n",
       "      <td>3.274219e+08</td>\n",
       "      <td>4.557968e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>000820.SZ</td>\n",
       "      <td>神雾节能</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>2.550938e+09</td>\n",
       "      <td>9.861318e+06</td>\n",
       "      <td>4.441687e+08</td>\n",
       "      <td>4.164500e+08</td>\n",
       "      <td>2.939347e+08</td>\n",
       "      <td>1.836391e+09</td>\n",
       "      <td>3.333251e+08</td>\n",
       "      <td>8.190880e+07</td>\n",
       "      <td>7.145473e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002776.SZ</td>\n",
       "      <td>ST柏龙</td>\n",
       "      <td>纺织服装</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>2.561272e+09</td>\n",
       "      <td>1.512387e+08</td>\n",
       "      <td>1.247969e+09</td>\n",
       "      <td>1.461103e+08</td>\n",
       "      <td>1.060385e+08</td>\n",
       "      <td>6.506575e+08</td>\n",
       "      <td>4.251079e+07</td>\n",
       "      <td>3.698023e+06</td>\n",
       "      <td>1.910615e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>600748.SH</td>\n",
       "      <td>上实发展</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>3.869392e+10</td>\n",
       "      <td>9.757817e+07</td>\n",
       "      <td>9.410630e+09</td>\n",
       "      <td>1.383166e+09</td>\n",
       "      <td>1.942242e+10</td>\n",
       "      <td>2.756497e+10</td>\n",
       "      <td>1.212087e+09</td>\n",
       "      <td>8.353998e+09</td>\n",
       "      <td>1.112895e+10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        股票代码  股票简称   行业名称                 公告日期           总资产          固定资产  \\\n",
       "0  002396.SZ  星网锐捷   通信设备  2017-12-31 00:00:00  6.439913e+09  4.844548e+08   \n",
       "1  002237.SZ  恒邦股份    贵金属  2017-12-31 00:00:00  1.343417e+10  3.613943e+09   \n",
       "2  000820.SZ  神雾节能   环保行业  2017-12-31 00:00:00  2.550938e+09  9.861318e+06   \n",
       "3  002776.SZ  ST柏龙   纺织服装  2017-12-31 00:00:00  2.561272e+09  1.512387e+08   \n",
       "4  600748.SH  上实发展  房地产开发  2017-12-31 00:00:00  3.869392e+10  9.757817e+07   \n",
       "\n",
       "           货币资金          应收账款            存货           总负债          应付账款  \\\n",
       "0  1.731688e+09  1.521677e+09  1.362966e+09  2.690476e+09  9.378150e+08   \n",
       "1  1.317289e+09  1.253392e+07  4.846801e+09  8.876205e+09  1.556165e+09   \n",
       "2  4.441687e+08  4.164500e+08  2.939347e+08  1.836391e+09  3.333251e+08   \n",
       "3  1.247969e+09  1.461103e+08  1.060385e+08  6.506575e+08  4.251079e+07   \n",
       "4  9.410630e+09  1.383166e+09  1.942242e+10  2.756497e+10  1.212087e+09   \n",
       "\n",
       "           预收账款         所有者权益  \n",
       "0  6.744459e+07  3.749436e+09  \n",
       "1  3.274219e+08  4.557968e+09  \n",
       "2  8.190880e+07  7.145473e+08  \n",
       "3  3.698023e+06  1.910615e+09  \n",
       "4  8.353998e+09  1.112895e+10  "
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "id": "c5f28c10-bb86-4332-81fd-db1f5a8e8331",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公告日期</th>\n",
       "      <th>股票代码</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">2017-12-31 00:00:00</th>\n",
       "      <th>002396.SZ</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>6.439913e+09</td>\n",
       "      <td>4.844548e+08</td>\n",
       "      <td>1.731688e+09</td>\n",
       "      <td>1.521677e+09</td>\n",
       "      <td>1.362966e+09</td>\n",
       "      <td>2.690476e+09</td>\n",
       "      <td>9.378150e+08</td>\n",
       "      <td>6.744459e+07</td>\n",
       "      <td>3.749436e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002237.SZ</th>\n",
       "      <td>恒邦股份</td>\n",
       "      <td>贵金属</td>\n",
       "      <td>1.343417e+10</td>\n",
       "      <td>3.613943e+09</td>\n",
       "      <td>1.317289e+09</td>\n",
       "      <td>1.253392e+07</td>\n",
       "      <td>4.846801e+09</td>\n",
       "      <td>8.876205e+09</td>\n",
       "      <td>1.556165e+09</td>\n",
       "      <td>3.274219e+08</td>\n",
       "      <td>4.557968e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000820.SZ</th>\n",
       "      <td>神雾节能</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>2.550938e+09</td>\n",
       "      <td>9.861318e+06</td>\n",
       "      <td>4.441687e+08</td>\n",
       "      <td>4.164500e+08</td>\n",
       "      <td>2.939347e+08</td>\n",
       "      <td>1.836391e+09</td>\n",
       "      <td>3.333251e+08</td>\n",
       "      <td>8.190880e+07</td>\n",
       "      <td>7.145473e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002776.SZ</th>\n",
       "      <td>ST柏龙</td>\n",
       "      <td>纺织服装</td>\n",
       "      <td>2.561272e+09</td>\n",
       "      <td>1.512387e+08</td>\n",
       "      <td>1.247969e+09</td>\n",
       "      <td>1.461103e+08</td>\n",
       "      <td>1.060385e+08</td>\n",
       "      <td>6.506575e+08</td>\n",
       "      <td>4.251079e+07</td>\n",
       "      <td>3.698023e+06</td>\n",
       "      <td>1.910615e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600748.SH</th>\n",
       "      <td>上实发展</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>3.869392e+10</td>\n",
       "      <td>9.757817e+07</td>\n",
       "      <td>9.410630e+09</td>\n",
       "      <td>1.383166e+09</td>\n",
       "      <td>1.942242e+10</td>\n",
       "      <td>2.756497e+10</td>\n",
       "      <td>1.212087e+09</td>\n",
       "      <td>8.353998e+09</td>\n",
       "      <td>1.112895e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">2021-12-31 00:00:00</th>\n",
       "      <th>300325.SZ</th>\n",
       "      <td>德威退</td>\n",
       "      <td>塑料制品</td>\n",
       "      <td>2.515615e+09</td>\n",
       "      <td>5.103316e+08</td>\n",
       "      <td>1.712263e+08</td>\n",
       "      <td>1.276471e+08</td>\n",
       "      <td>1.635077e+08</td>\n",
       "      <td>2.829299e+09</td>\n",
       "      <td>8.564501e+07</td>\n",
       "      <td>5.793591e+07</td>\n",
       "      <td>-3.136841e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002770.SZ</th>\n",
       "      <td>科迪退</td>\n",
       "      <td>食品饮料</td>\n",
       "      <td>2.414398e+09</td>\n",
       "      <td>1.175702e+09</td>\n",
       "      <td>1.801607e+07</td>\n",
       "      <td>7.795656e+06</td>\n",
       "      <td>5.443509e+07</td>\n",
       "      <td>2.241976e+09</td>\n",
       "      <td>2.019216e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.724227e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002260.SZ</th>\n",
       "      <td>德奥退</td>\n",
       "      <td>家电行业</td>\n",
       "      <td>8.372433e+08</td>\n",
       "      <td>8.415270e+07</td>\n",
       "      <td>2.436602e+08</td>\n",
       "      <td>9.243759e+07</td>\n",
       "      <td>5.084700e+07</td>\n",
       "      <td>6.770779e+08</td>\n",
       "      <td>6.709732e+07</td>\n",
       "      <td>3.693987e+06</td>\n",
       "      <td>1.601655e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300178.SZ</th>\n",
       "      <td>腾邦退</td>\n",
       "      <td>旅游酒店</td>\n",
       "      <td>4.169976e+09</td>\n",
       "      <td>2.082842e+08</td>\n",
       "      <td>8.016624e+07</td>\n",
       "      <td>1.193530e+08</td>\n",
       "      <td>3.480466e+07</td>\n",
       "      <td>5.518111e+09</td>\n",
       "      <td>2.619102e+08</td>\n",
       "      <td>6.411086e+07</td>\n",
       "      <td>-1.348135e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300201.SZ</th>\n",
       "      <td>*ST海伦</td>\n",
       "      <td>工程机械</td>\n",
       "      <td>2.329837e+09</td>\n",
       "      <td>3.585854e+08</td>\n",
       "      <td>2.539929e+08</td>\n",
       "      <td>7.116661e+08</td>\n",
       "      <td>2.169490e+08</td>\n",
       "      <td>1.042089e+09</td>\n",
       "      <td>5.877885e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.287748e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>26879 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                股票简称   行业名称           总资产          固定资产  \\\n",
       "公告日期                股票代码                                                  \n",
       "2017-12-31 00:00:00 002396.SZ   星网锐捷   通信设备  6.439913e+09  4.844548e+08   \n",
       "                    002237.SZ   恒邦股份    贵金属  1.343417e+10  3.613943e+09   \n",
       "                    000820.SZ   神雾节能   环保行业  2.550938e+09  9.861318e+06   \n",
       "                    002776.SZ   ST柏龙   纺织服装  2.561272e+09  1.512387e+08   \n",
       "                    600748.SH   上实发展  房地产开发  3.869392e+10  9.757817e+07   \n",
       "...                              ...    ...           ...           ...   \n",
       "2021-12-31 00:00:00 300325.SZ    德威退   塑料制品  2.515615e+09  5.103316e+08   \n",
       "                    002770.SZ    科迪退   食品饮料  2.414398e+09  1.175702e+09   \n",
       "                    002260.SZ    德奥退   家电行业  8.372433e+08  8.415270e+07   \n",
       "                    300178.SZ    腾邦退   旅游酒店  4.169976e+09  2.082842e+08   \n",
       "                    300201.SZ  *ST海伦   工程机械  2.329837e+09  3.585854e+08   \n",
       "\n",
       "                                       货币资金          应收账款            存货  \\\n",
       "公告日期                股票代码                                                  \n",
       "2017-12-31 00:00:00 002396.SZ  1.731688e+09  1.521677e+09  1.362966e+09   \n",
       "                    002237.SZ  1.317289e+09  1.253392e+07  4.846801e+09   \n",
       "                    000820.SZ  4.441687e+08  4.164500e+08  2.939347e+08   \n",
       "                    002776.SZ  1.247969e+09  1.461103e+08  1.060385e+08   \n",
       "                    600748.SH  9.410630e+09  1.383166e+09  1.942242e+10   \n",
       "...                                     ...           ...           ...   \n",
       "2021-12-31 00:00:00 300325.SZ  1.712263e+08  1.276471e+08  1.635077e+08   \n",
       "                    002770.SZ  1.801607e+07  7.795656e+06  5.443509e+07   \n",
       "                    002260.SZ  2.436602e+08  9.243759e+07  5.084700e+07   \n",
       "                    300178.SZ  8.016624e+07  1.193530e+08  3.480466e+07   \n",
       "                    300201.SZ  2.539929e+08  7.116661e+08  2.169490e+08   \n",
       "\n",
       "                                        总负债          应付账款          预收账款  \\\n",
       "公告日期                股票代码                                                  \n",
       "2017-12-31 00:00:00 002396.SZ  2.690476e+09  9.378150e+08  6.744459e+07   \n",
       "                    002237.SZ  8.876205e+09  1.556165e+09  3.274219e+08   \n",
       "                    000820.SZ  1.836391e+09  3.333251e+08  8.190880e+07   \n",
       "                    002776.SZ  6.506575e+08  4.251079e+07  3.698023e+06   \n",
       "                    600748.SH  2.756497e+10  1.212087e+09  8.353998e+09   \n",
       "...                                     ...           ...           ...   \n",
       "2021-12-31 00:00:00 300325.SZ  2.829299e+09  8.564501e+07  5.793591e+07   \n",
       "                    002770.SZ  2.241976e+09  2.019216e+08           NaN   \n",
       "                    002260.SZ  6.770779e+08  6.709732e+07  3.693987e+06   \n",
       "                    300178.SZ  5.518111e+09  2.619102e+08  6.411086e+07   \n",
       "                    300201.SZ  1.042089e+09  5.877885e+08           NaN   \n",
       "\n",
       "                                      所有者权益  \n",
       "公告日期                股票代码                     \n",
       "2017-12-31 00:00:00 002396.SZ  3.749436e+09  \n",
       "                    002237.SZ  4.557968e+09  \n",
       "                    000820.SZ  7.145473e+08  \n",
       "                    002776.SZ  1.910615e+09  \n",
       "                    600748.SH  1.112895e+10  \n",
       "...                                     ...  \n",
       "2021-12-31 00:00:00 300325.SZ -3.136841e+08  \n",
       "                    002770.SZ  1.724227e+08  \n",
       "                    002260.SZ  1.601655e+08  \n",
       "                    300178.SZ -1.348135e+09  \n",
       "                    300201.SZ  1.287748e+09  \n",
       "\n",
       "[26879 rows x 11 columns]"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index = total_zcfz_df.set_index(['公告日期', '股票代码'])\n",
    "total_zcfz_df_index.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b755cce4-9c92-4cb3-825b-a6bf9d50801b",
   "metadata": {},
   "source": [
    "### 复原 reset_index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "id": "6166b94a-fa77-4258-b31c-5cf4d1c74ff5",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>公告日期</th>\n",
       "      <th>股票代码</th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002396.SZ</td>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>6.439913e+09</td>\n",
       "      <td>4.844548e+08</td>\n",
       "      <td>1.731688e+09</td>\n",
       "      <td>1.521677e+09</td>\n",
       "      <td>1.362966e+09</td>\n",
       "      <td>2.690476e+09</td>\n",
       "      <td>9.378150e+08</td>\n",
       "      <td>6.744459e+07</td>\n",
       "      <td>3.749436e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002237.SZ</td>\n",
       "      <td>恒邦股份</td>\n",
       "      <td>贵金属</td>\n",
       "      <td>1.343417e+10</td>\n",
       "      <td>3.613943e+09</td>\n",
       "      <td>1.317289e+09</td>\n",
       "      <td>1.253392e+07</td>\n",
       "      <td>4.846801e+09</td>\n",
       "      <td>8.876205e+09</td>\n",
       "      <td>1.556165e+09</td>\n",
       "      <td>3.274219e+08</td>\n",
       "      <td>4.557968e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>000820.SZ</td>\n",
       "      <td>神雾节能</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>2.550938e+09</td>\n",
       "      <td>9.861318e+06</td>\n",
       "      <td>4.441687e+08</td>\n",
       "      <td>4.164500e+08</td>\n",
       "      <td>2.939347e+08</td>\n",
       "      <td>1.836391e+09</td>\n",
       "      <td>3.333251e+08</td>\n",
       "      <td>8.190880e+07</td>\n",
       "      <td>7.145473e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002776.SZ</td>\n",
       "      <td>ST柏龙</td>\n",
       "      <td>纺织服装</td>\n",
       "      <td>2.561272e+09</td>\n",
       "      <td>1.512387e+08</td>\n",
       "      <td>1.247969e+09</td>\n",
       "      <td>1.461103e+08</td>\n",
       "      <td>1.060385e+08</td>\n",
       "      <td>6.506575e+08</td>\n",
       "      <td>4.251079e+07</td>\n",
       "      <td>3.698023e+06</td>\n",
       "      <td>1.910615e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>600748.SH</td>\n",
       "      <td>上实发展</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>3.869392e+10</td>\n",
       "      <td>9.757817e+07</td>\n",
       "      <td>9.410630e+09</td>\n",
       "      <td>1.383166e+09</td>\n",
       "      <td>1.942242e+10</td>\n",
       "      <td>2.756497e+10</td>\n",
       "      <td>1.212087e+09</td>\n",
       "      <td>8.353998e+09</td>\n",
       "      <td>1.112895e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26874</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>300325.SZ</td>\n",
       "      <td>德威退</td>\n",
       "      <td>塑料制品</td>\n",
       "      <td>2.515615e+09</td>\n",
       "      <td>5.103316e+08</td>\n",
       "      <td>1.712263e+08</td>\n",
       "      <td>1.276471e+08</td>\n",
       "      <td>1.635077e+08</td>\n",
       "      <td>2.829299e+09</td>\n",
       "      <td>8.564501e+07</td>\n",
       "      <td>5.793591e+07</td>\n",
       "      <td>-3.136841e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26875</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>002770.SZ</td>\n",
       "      <td>科迪退</td>\n",
       "      <td>食品饮料</td>\n",
       "      <td>2.414398e+09</td>\n",
       "      <td>1.175702e+09</td>\n",
       "      <td>1.801607e+07</td>\n",
       "      <td>7.795656e+06</td>\n",
       "      <td>5.443509e+07</td>\n",
       "      <td>2.241976e+09</td>\n",
       "      <td>2.019216e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.724227e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26876</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>002260.SZ</td>\n",
       "      <td>德奥退</td>\n",
       "      <td>家电行业</td>\n",
       "      <td>8.372433e+08</td>\n",
       "      <td>8.415270e+07</td>\n",
       "      <td>2.436602e+08</td>\n",
       "      <td>9.243759e+07</td>\n",
       "      <td>5.084700e+07</td>\n",
       "      <td>6.770779e+08</td>\n",
       "      <td>6.709732e+07</td>\n",
       "      <td>3.693987e+06</td>\n",
       "      <td>1.601655e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26877</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>300178.SZ</td>\n",
       "      <td>腾邦退</td>\n",
       "      <td>旅游酒店</td>\n",
       "      <td>4.169976e+09</td>\n",
       "      <td>2.082842e+08</td>\n",
       "      <td>8.016624e+07</td>\n",
       "      <td>1.193530e+08</td>\n",
       "      <td>3.480466e+07</td>\n",
       "      <td>5.518111e+09</td>\n",
       "      <td>2.619102e+08</td>\n",
       "      <td>6.411086e+07</td>\n",
       "      <td>-1.348135e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26878</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>300201.SZ</td>\n",
       "      <td>*ST海伦</td>\n",
       "      <td>工程机械</td>\n",
       "      <td>2.329837e+09</td>\n",
       "      <td>3.585854e+08</td>\n",
       "      <td>2.539929e+08</td>\n",
       "      <td>7.116661e+08</td>\n",
       "      <td>2.169490e+08</td>\n",
       "      <td>1.042089e+09</td>\n",
       "      <td>5.877885e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.287748e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>26879 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                      公告日期       股票代码   股票简称   行业名称           总资产  \\\n",
       "0      2017-12-31 00:00:00  002396.SZ   星网锐捷   通信设备  6.439913e+09   \n",
       "1      2017-12-31 00:00:00  002237.SZ   恒邦股份    贵金属  1.343417e+10   \n",
       "2      2017-12-31 00:00:00  000820.SZ   神雾节能   环保行业  2.550938e+09   \n",
       "3      2017-12-31 00:00:00  002776.SZ   ST柏龙   纺织服装  2.561272e+09   \n",
       "4      2017-12-31 00:00:00  600748.SH   上实发展  房地产开发  3.869392e+10   \n",
       "...                    ...        ...    ...    ...           ...   \n",
       "26874  2021-12-31 00:00:00  300325.SZ    德威退   塑料制品  2.515615e+09   \n",
       "26875  2021-12-31 00:00:00  002770.SZ    科迪退   食品饮料  2.414398e+09   \n",
       "26876  2021-12-31 00:00:00  002260.SZ    德奥退   家电行业  8.372433e+08   \n",
       "26877  2021-12-31 00:00:00  300178.SZ    腾邦退   旅游酒店  4.169976e+09   \n",
       "26878  2021-12-31 00:00:00  300201.SZ  *ST海伦   工程机械  2.329837e+09   \n",
       "\n",
       "               固定资产          货币资金          应收账款            存货           总负债  \\\n",
       "0      4.844548e+08  1.731688e+09  1.521677e+09  1.362966e+09  2.690476e+09   \n",
       "1      3.613943e+09  1.317289e+09  1.253392e+07  4.846801e+09  8.876205e+09   \n",
       "2      9.861318e+06  4.441687e+08  4.164500e+08  2.939347e+08  1.836391e+09   \n",
       "3      1.512387e+08  1.247969e+09  1.461103e+08  1.060385e+08  6.506575e+08   \n",
       "4      9.757817e+07  9.410630e+09  1.383166e+09  1.942242e+10  2.756497e+10   \n",
       "...             ...           ...           ...           ...           ...   \n",
       "26874  5.103316e+08  1.712263e+08  1.276471e+08  1.635077e+08  2.829299e+09   \n",
       "26875  1.175702e+09  1.801607e+07  7.795656e+06  5.443509e+07  2.241976e+09   \n",
       "26876  8.415270e+07  2.436602e+08  9.243759e+07  5.084700e+07  6.770779e+08   \n",
       "26877  2.082842e+08  8.016624e+07  1.193530e+08  3.480466e+07  5.518111e+09   \n",
       "26878  3.585854e+08  2.539929e+08  7.116661e+08  2.169490e+08  1.042089e+09   \n",
       "\n",
       "               应付账款          预收账款         所有者权益  \n",
       "0      9.378150e+08  6.744459e+07  3.749436e+09  \n",
       "1      1.556165e+09  3.274219e+08  4.557968e+09  \n",
       "2      3.333251e+08  8.190880e+07  7.145473e+08  \n",
       "3      4.251079e+07  3.698023e+06  1.910615e+09  \n",
       "4      1.212087e+09  8.353998e+09  1.112895e+10  \n",
       "...             ...           ...           ...  \n",
       "26874  8.564501e+07  5.793591e+07 -3.136841e+08  \n",
       "26875  2.019216e+08           NaN  1.724227e+08  \n",
       "26876  6.709732e+07  3.693987e+06  1.601655e+08  \n",
       "26877  2.619102e+08  6.411086e+07 -1.348135e+09  \n",
       "26878  5.877885e+08           NaN  1.287748e+09  \n",
       "\n",
       "[26879 rows x 13 columns]"
      ]
     },
     "execution_count": 136,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index.reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "id": "136a88fc-c4ee-46ae-8bcc-a6f219b42ff7",
   "metadata": {},
   "outputs": [],
   "source": [
    "total_zcfz_df = total_zcfz_df_index.reset_index()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c6697b98-575b-4fab-8649-0935f048268d",
   "metadata": {},
   "source": [
    "### 获取 loc两次"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a2f36829-1617-43b6-bce9-83e3f44542b9",
   "metadata": {},
   "source": [
    "### 索引交换 swaplevel"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb185781-5f4d-42b2-ae6f-7f6b3b96fa29",
   "metadata": {},
   "source": [
    "不交换只能一层一层剥开它的索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "id": "bc0734f9-9b8c-42f1-8b81-134d050ce734",
   "metadata": {},
   "outputs": [],
   "source": [
    "total_zcfz_df_index = total_zcfz_df.set_index(['公告日期', '股票代码'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "id": "05a7df74-5e8d-4f3b-b7d1-0ca513ac5633",
   "metadata": {},
   "outputs": [],
   "source": [
    "total_lrb_df_index = total_lrb_df.set_index(['公告日期', '股票代码'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "id": "d91e80d6-e2ac-4f9b-a71f-40e4697ff419",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票代码</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>688376.SH</th>\n",
       "      <td>美埃科技</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>1.263493e+09</td>\n",
       "      <td>1.184056e+08</td>\n",
       "      <td>1.333633e+08</td>\n",
       "      <td>3.722458e+08</td>\n",
       "      <td>3.411116e+08</td>\n",
       "      <td>7.989122e+08</td>\n",
       "      <td>2.576968e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.645811e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603130.SH</th>\n",
       "      <td>云中马</td>\n",
       "      <td>纺织服装</td>\n",
       "      <td>1.335698e+09</td>\n",
       "      <td>3.059372e+08</td>\n",
       "      <td>3.736742e+08</td>\n",
       "      <td>2.168760e+08</td>\n",
       "      <td>1.596310e+08</td>\n",
       "      <td>8.175257e+08</td>\n",
       "      <td>2.589460e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.181727e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688489.SH</th>\n",
       "      <td>三未信安</td>\n",
       "      <td>电子元件</td>\n",
       "      <td>4.687408e+08</td>\n",
       "      <td>2.117952e+07</td>\n",
       "      <td>1.343006e+08</td>\n",
       "      <td>1.767098e+08</td>\n",
       "      <td>4.184802e+07</td>\n",
       "      <td>8.182332e+07</td>\n",
       "      <td>2.083729e+07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.869175e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688419.SH</th>\n",
       "      <td>耐科装备</td>\n",
       "      <td>专用设备</td>\n",
       "      <td>3.828846e+08</td>\n",
       "      <td>5.100749e+07</td>\n",
       "      <td>8.196114e+07</td>\n",
       "      <td>6.420622e+07</td>\n",
       "      <td>1.125969e+08</td>\n",
       "      <td>1.984657e+08</td>\n",
       "      <td>8.628777e+07</td>\n",
       "      <td>84826.20</td>\n",
       "      <td>1.844189e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688362.SH</th>\n",
       "      <td>甬矽电子</td>\n",
       "      <td>半导体</td>\n",
       "      <td>4.632186e+09</td>\n",
       "      <td>3.077213e+09</td>\n",
       "      <td>2.951204e+08</td>\n",
       "      <td>3.961315e+08</td>\n",
       "      <td>2.788765e+08</td>\n",
       "      <td>3.259094e+09</td>\n",
       "      <td>5.627755e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.373092e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300325.SZ</th>\n",
       "      <td>德威退</td>\n",
       "      <td>塑料制品</td>\n",
       "      <td>2.515615e+09</td>\n",
       "      <td>5.103316e+08</td>\n",
       "      <td>1.712263e+08</td>\n",
       "      <td>1.276471e+08</td>\n",
       "      <td>1.635077e+08</td>\n",
       "      <td>2.829299e+09</td>\n",
       "      <td>8.564501e+07</td>\n",
       "      <td>57935913.39</td>\n",
       "      <td>-3.136841e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002770.SZ</th>\n",
       "      <td>科迪退</td>\n",
       "      <td>食品饮料</td>\n",
       "      <td>2.414398e+09</td>\n",
       "      <td>1.175702e+09</td>\n",
       "      <td>1.801607e+07</td>\n",
       "      <td>7.795656e+06</td>\n",
       "      <td>5.443509e+07</td>\n",
       "      <td>2.241976e+09</td>\n",
       "      <td>2.019216e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.724227e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002260.SZ</th>\n",
       "      <td>德奥退</td>\n",
       "      <td>家电行业</td>\n",
       "      <td>8.372433e+08</td>\n",
       "      <td>8.415270e+07</td>\n",
       "      <td>2.436602e+08</td>\n",
       "      <td>9.243759e+07</td>\n",
       "      <td>5.084700e+07</td>\n",
       "      <td>6.770779e+08</td>\n",
       "      <td>6.709732e+07</td>\n",
       "      <td>3693987.19</td>\n",
       "      <td>1.601655e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300178.SZ</th>\n",
       "      <td>腾邦退</td>\n",
       "      <td>旅游酒店</td>\n",
       "      <td>4.169976e+09</td>\n",
       "      <td>2.082842e+08</td>\n",
       "      <td>8.016624e+07</td>\n",
       "      <td>1.193530e+08</td>\n",
       "      <td>3.480466e+07</td>\n",
       "      <td>5.518111e+09</td>\n",
       "      <td>2.619102e+08</td>\n",
       "      <td>64110864.12</td>\n",
       "      <td>-1.348135e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300201.SZ</th>\n",
       "      <td>*ST海伦</td>\n",
       "      <td>工程机械</td>\n",
       "      <td>2.329837e+09</td>\n",
       "      <td>3.585854e+08</td>\n",
       "      <td>2.539929e+08</td>\n",
       "      <td>7.116661e+08</td>\n",
       "      <td>2.169490e+08</td>\n",
       "      <td>1.042089e+09</td>\n",
       "      <td>5.877885e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.287748e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5379 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            股票简称  行业名称           总资产          固定资产          货币资金  \\\n",
       "股票代码                                                               \n",
       "688376.SH   美埃科技  环保行业  1.263493e+09  1.184056e+08  1.333633e+08   \n",
       "603130.SH    云中马  纺织服装  1.335698e+09  3.059372e+08  3.736742e+08   \n",
       "688489.SH   三未信安  电子元件  4.687408e+08  2.117952e+07  1.343006e+08   \n",
       "688419.SH   耐科装备  专用设备  3.828846e+08  5.100749e+07  8.196114e+07   \n",
       "688362.SH   甬矽电子   半导体  4.632186e+09  3.077213e+09  2.951204e+08   \n",
       "...          ...   ...           ...           ...           ...   \n",
       "300325.SZ    德威退  塑料制品  2.515615e+09  5.103316e+08  1.712263e+08   \n",
       "002770.SZ    科迪退  食品饮料  2.414398e+09  1.175702e+09  1.801607e+07   \n",
       "002260.SZ    德奥退  家电行业  8.372433e+08  8.415270e+07  2.436602e+08   \n",
       "300178.SZ    腾邦退  旅游酒店  4.169976e+09  2.082842e+08  8.016624e+07   \n",
       "300201.SZ  *ST海伦  工程机械  2.329837e+09  3.585854e+08  2.539929e+08   \n",
       "\n",
       "                   应收账款            存货           总负债          应付账款  \\\n",
       "股票代码                                                                \n",
       "688376.SH  3.722458e+08  3.411116e+08  7.989122e+08  2.576968e+08   \n",
       "603130.SH  2.168760e+08  1.596310e+08  8.175257e+08  2.589460e+08   \n",
       "688489.SH  1.767098e+08  4.184802e+07  8.182332e+07  2.083729e+07   \n",
       "688419.SH  6.420622e+07  1.125969e+08  1.984657e+08  8.628777e+07   \n",
       "688362.SH  3.961315e+08  2.788765e+08  3.259094e+09  5.627755e+08   \n",
       "...                 ...           ...           ...           ...   \n",
       "300325.SZ  1.276471e+08  1.635077e+08  2.829299e+09  8.564501e+07   \n",
       "002770.SZ  7.795656e+06  5.443509e+07  2.241976e+09  2.019216e+08   \n",
       "002260.SZ  9.243759e+07  5.084700e+07  6.770779e+08  6.709732e+07   \n",
       "300178.SZ  1.193530e+08  3.480466e+07  5.518111e+09  2.619102e+08   \n",
       "300201.SZ  7.116661e+08  2.169490e+08  1.042089e+09  5.877885e+08   \n",
       "\n",
       "                  预收账款         所有者权益  \n",
       "股票代码                                  \n",
       "688376.SH          NaN  4.645811e+08  \n",
       "603130.SH          NaN  5.181727e+08  \n",
       "688489.SH          NaN  3.869175e+08  \n",
       "688419.SH     84826.20  1.844189e+08  \n",
       "688362.SH          NaN  1.373092e+09  \n",
       "...                ...           ...  \n",
       "300325.SZ  57935913.39 -3.136841e+08  \n",
       "002770.SZ          NaN  1.724227e+08  \n",
       "002260.SZ   3693987.19  1.601655e+08  \n",
       "300178.SZ  64110864.12 -1.348135e+09  \n",
       "300201.SZ          NaN  1.287748e+09  \n",
       "\n",
       "[5379 rows x 11 columns]"
      ]
     },
     "execution_count": 142,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index.loc['2021-12-31 00:00:00']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "id": "446bf195-8b9b-43b7-bc77-d4e9a9385312",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公告日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2017-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>6.439913e+09</td>\n",
       "      <td>4.844548e+08</td>\n",
       "      <td>1.731688e+09</td>\n",
       "      <td>1.521677e+09</td>\n",
       "      <td>1.362966e+09</td>\n",
       "      <td>2.690476e+09</td>\n",
       "      <td>9.378150e+08</td>\n",
       "      <td>6.744459e+07</td>\n",
       "      <td>3.749436e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>6.439913e+09</td>\n",
       "      <td>4.844548e+08</td>\n",
       "      <td>1.731688e+09</td>\n",
       "      <td>1.521677e+09</td>\n",
       "      <td>1.362966e+09</td>\n",
       "      <td>2.690476e+09</td>\n",
       "      <td>9.378150e+08</td>\n",
       "      <td>6.744459e+07</td>\n",
       "      <td>3.749436e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>6.999109e+09</td>\n",
       "      <td>5.647691e+08</td>\n",
       "      <td>1.633702e+09</td>\n",
       "      <td>1.732376e+09</td>\n",
       "      <td>1.542495e+09</td>\n",
       "      <td>2.734762e+09</td>\n",
       "      <td>1.069377e+09</td>\n",
       "      <td>8.334161e+07</td>\n",
       "      <td>4.264346e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>6.999109e+09</td>\n",
       "      <td>5.647691e+08</td>\n",
       "      <td>1.633702e+09</td>\n",
       "      <td>1.732376e+09</td>\n",
       "      <td>1.542495e+09</td>\n",
       "      <td>2.734762e+09</td>\n",
       "      <td>1.069377e+09</td>\n",
       "      <td>8.334161e+07</td>\n",
       "      <td>4.264346e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>7.650634e+09</td>\n",
       "      <td>5.540331e+08</td>\n",
       "      <td>2.054035e+09</td>\n",
       "      <td>1.831114e+09</td>\n",
       "      <td>1.649794e+09</td>\n",
       "      <td>2.814118e+09</td>\n",
       "      <td>1.175606e+09</td>\n",
       "      <td>1.201577e+08</td>\n",
       "      <td>4.836516e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>7.650634e+09</td>\n",
       "      <td>5.540331e+08</td>\n",
       "      <td>2.054035e+09</td>\n",
       "      <td>1.831114e+09</td>\n",
       "      <td>1.649794e+09</td>\n",
       "      <td>2.814118e+09</td>\n",
       "      <td>1.175606e+09</td>\n",
       "      <td>1.201577e+08</td>\n",
       "      <td>4.836516e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>8.715630e+09</td>\n",
       "      <td>7.316542e+08</td>\n",
       "      <td>2.101200e+09</td>\n",
       "      <td>1.685647e+09</td>\n",
       "      <td>2.323741e+09</td>\n",
       "      <td>3.833001e+09</td>\n",
       "      <td>1.271083e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.882629e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>8.715630e+09</td>\n",
       "      <td>7.316542e+08</td>\n",
       "      <td>2.101200e+09</td>\n",
       "      <td>1.685647e+09</td>\n",
       "      <td>2.323741e+09</td>\n",
       "      <td>3.833001e+09</td>\n",
       "      <td>1.271083e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.882629e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-12-31 00:00:00</th>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>1.112296e+10</td>\n",
       "      <td>8.025267e+08</td>\n",
       "      <td>2.141405e+09</td>\n",
       "      <td>1.758021e+09</td>\n",
       "      <td>4.038957e+09</td>\n",
       "      <td>5.470682e+09</td>\n",
       "      <td>1.840501e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.652276e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     股票简称  行业名称           总资产          固定资产          货币资金  \\\n",
       "公告日期                                                                        \n",
       "2017-12-31 00:00:00  星网锐捷  通信设备  6.439913e+09  4.844548e+08  1.731688e+09   \n",
       "2017-12-31 00:00:00  星网锐捷  通信设备  6.439913e+09  4.844548e+08  1.731688e+09   \n",
       "2018-12-31 00:00:00  星网锐捷  通信设备  6.999109e+09  5.647691e+08  1.633702e+09   \n",
       "2018-12-31 00:00:00  星网锐捷  通信设备  6.999109e+09  5.647691e+08  1.633702e+09   \n",
       "2019-12-31 00:00:00  星网锐捷  通信设备  7.650634e+09  5.540331e+08  2.054035e+09   \n",
       "2019-12-31 00:00:00  星网锐捷  通信设备  7.650634e+09  5.540331e+08  2.054035e+09   \n",
       "2020-12-31 00:00:00  星网锐捷  通信设备  8.715630e+09  7.316542e+08  2.101200e+09   \n",
       "2020-12-31 00:00:00  星网锐捷  通信设备  8.715630e+09  7.316542e+08  2.101200e+09   \n",
       "2021-12-31 00:00:00  星网锐捷  通信设备  1.112296e+10  8.025267e+08  2.141405e+09   \n",
       "\n",
       "                             应收账款            存货           总负债          应付账款  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00  1.521677e+09  1.362966e+09  2.690476e+09  9.378150e+08   \n",
       "2017-12-31 00:00:00  1.521677e+09  1.362966e+09  2.690476e+09  9.378150e+08   \n",
       "2018-12-31 00:00:00  1.732376e+09  1.542495e+09  2.734762e+09  1.069377e+09   \n",
       "2018-12-31 00:00:00  1.732376e+09  1.542495e+09  2.734762e+09  1.069377e+09   \n",
       "2019-12-31 00:00:00  1.831114e+09  1.649794e+09  2.814118e+09  1.175606e+09   \n",
       "2019-12-31 00:00:00  1.831114e+09  1.649794e+09  2.814118e+09  1.175606e+09   \n",
       "2020-12-31 00:00:00  1.685647e+09  2.323741e+09  3.833001e+09  1.271083e+09   \n",
       "2020-12-31 00:00:00  1.685647e+09  2.323741e+09  3.833001e+09  1.271083e+09   \n",
       "2021-12-31 00:00:00  1.758021e+09  4.038957e+09  5.470682e+09  1.840501e+09   \n",
       "\n",
       "                             预收账款         所有者权益  \n",
       "公告日期                                             \n",
       "2017-12-31 00:00:00  6.744459e+07  3.749436e+09  \n",
       "2017-12-31 00:00:00  6.744459e+07  3.749436e+09  \n",
       "2018-12-31 00:00:00  8.334161e+07  4.264346e+09  \n",
       "2018-12-31 00:00:00  8.334161e+07  4.264346e+09  \n",
       "2019-12-31 00:00:00  1.201577e+08  4.836516e+09  \n",
       "2019-12-31 00:00:00  1.201577e+08  4.836516e+09  \n",
       "2020-12-31 00:00:00           NaN  4.882629e+09  \n",
       "2020-12-31 00:00:00           NaN  4.882629e+09  \n",
       "2021-12-31 00:00:00           NaN  5.652276e+09  "
      ]
     },
     "execution_count": 146,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index.swaplevel().loc['002396.SZ']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d439ebf8-cd13-4371-a061-7f78064e1217",
   "metadata": {},
   "source": [
    "## 同期数据拼接：索引的结构变换"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2398e782-5fb4-47ed-a830-4b943ea24eec",
   "metadata": {},
   "source": [
    "### 数据的偏移：shift"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "273fe8c3-7f6c-41b8-a7fc-ef47ac42dc92",
   "metadata": {},
   "source": [
    "杜邦分析需要我们将一些指标进行期末和期初的平均，如ROE的所有者权益部分  \n",
    "这就需要我们把同股票、不同年份的数据整体偏移1个单位，然后对位相加"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "id": "84acd6ab-416f-4fb8-864f-5d03d2287f8d",
   "metadata": {},
   "outputs": [],
   "source": [
    ">>> df1 = pd.DataFrame({'people': ['afan', 'afan', 'afan', 'stella', 'stella'],\n",
    "...                    'year': [2011, 2012, 2013, 2013, 2014],\n",
    "...                    'sale': [55, 40, 60, 84, 31],\n",
    "                      })"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
   "id": "250646c2-2a03-49f4-afe9-64bfb7fd6f86",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>people</th>\n",
       "      <th>year</th>\n",
       "      <th>sale</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>afan</td>\n",
       "      <td>2011</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>afan</td>\n",
       "      <td>2012</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>afan</td>\n",
       "      <td>2013</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>stella</td>\n",
       "      <td>2013</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>stella</td>\n",
       "      <td>2014</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   people  year  sale\n",
       "0    afan  2011    55\n",
       "1    afan  2012    40\n",
       "2    afan  2013    60\n",
       "3  stella  2013    84\n",
       "4  stella  2014    31"
      ]
     },
     "execution_count": 165,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "id": "c52e9134-0ff3-4d72-bc31-41102c8dbf6a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>people</th>\n",
       "      <th>year</th>\n",
       "      <th>sale</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>afan</td>\n",
       "      <td>2011</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>afan</td>\n",
       "      <td>2012</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>afan</td>\n",
       "      <td>2013</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  people  year  sale\n",
       "0   afan  2011    55\n",
       "1   afan  2012    40\n",
       "2   afan  2013    60"
      ]
     },
     "execution_count": 166,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " df1[df1['people']=='afan']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "id": "3d8ab07f-81f5-4356-ac10-8e67710eb67c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>sale</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>year</th>\n",
       "      <th>people</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2011</th>\n",
       "      <th>afan</th>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2012</th>\n",
       "      <th>afan</th>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013</th>\n",
       "      <th>afan</th>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             sale\n",
       "year people      \n",
       "2011 afan      55\n",
       "2012 afan      40\n",
       "2013 afan      60"
      ]
     },
     "execution_count": 167,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_df1 = df1[df1['people']=='afan'].set_index(['year', 'people'])\n",
    "tmp_df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "id": "59170c5b-3a1d-4b23-9087-70ee51d2397d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>sale</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>year</th>\n",
       "      <th>people</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2011</th>\n",
       "      <th>afan</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2012</th>\n",
       "      <th>afan</th>\n",
       "      <td>55.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013</th>\n",
       "      <th>afan</th>\n",
       "      <td>40.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             sale\n",
       "year people      \n",
       "2011 afan     NaN\n",
       "2012 afan    55.0\n",
       "2013 afan    40.0"
      ]
     },
     "execution_count": 169,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_df1.shift(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "id": "1e9dcdf5-b323-4e8c-95bd-59091e50ce25",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>sale</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>year</th>\n",
       "      <th>people</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2011</th>\n",
       "      <th>afan</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2012</th>\n",
       "      <th>afan</th>\n",
       "      <td>95.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013</th>\n",
       "      <th>afan</th>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              sale\n",
       "year people       \n",
       "2011 afan      NaN\n",
       "2012 afan     95.0\n",
       "2013 afan    100.0"
      ]
     },
     "execution_count": 171,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp_df1 + tmp_df1.shift(1) "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3556f3b-5a1b-4e2f-9210-94e83ffb5966",
   "metadata": {},
   "source": [
    "不能简单shift了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "id": "1977826c-9c96-4f95-9d60-7319744d79c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "公告日期                 股票代码     \n",
       "2017-12-31 00:00:00  002396.SZ             NaN\n",
       "                     002237.SZ    4.844548e+08\n",
       "                     000820.SZ    3.613943e+09\n",
       "                     002776.SZ    9.861318e+06\n",
       "                     600748.SH    1.512387e+08\n",
       "                                      ...     \n",
       "2021-12-31 00:00:00  300325.SZ    5.516112e+08\n",
       "                     002770.SZ    5.103316e+08\n",
       "                     002260.SZ    1.175702e+09\n",
       "                     300178.SZ    8.415270e+07\n",
       "                     300201.SZ    2.082842e+08\n",
       "Name: 固定资产, Length: 26879, dtype: float64"
      ]
     },
     "execution_count": 175,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index['固定资产'].shift(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 179,
   "id": "05ed092b-d209-4460-9dfd-fabfca27f5fa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">sale</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>people</th>\n",
       "      <th>afan</th>\n",
       "      <th>stella</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>year</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2011</th>\n",
       "      <td>55.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2012</th>\n",
       "      <td>40.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013</th>\n",
       "      <td>60.0</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014</th>\n",
       "      <td>NaN</td>\n",
       "      <td>31.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        sale       \n",
       "people  afan stella\n",
       "year               \n",
       "2011    55.0    NaN\n",
       "2012    40.0    NaN\n",
       "2013    60.0   84.0\n",
       "2014     NaN   31.0"
      ]
     },
     "execution_count": 179,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.set_index(['year', 'people']).unstack('people')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "id": "6489892d-26f1-427c-bddc-ba4169bebc9f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">sale</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>people</th>\n",
       "      <th>afan</th>\n",
       "      <th>stella</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>year</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2011</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2012</th>\n",
       "      <td>55.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013</th>\n",
       "      <td>40.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014</th>\n",
       "      <td>60.0</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        sale       \n",
       "people  afan stella\n",
       "year               \n",
       "2011     NaN    NaN\n",
       "2012    55.0    NaN\n",
       "2013    40.0    NaN\n",
       "2014    60.0   84.0"
      ]
     },
     "execution_count": 180,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.set_index(['year', 'people']).unstack('people').shift(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 182,
   "id": "f8bc81ad-7bb6-4339-b6a3-b7c7c557b5a8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "公告日期                 股票代码     \n",
       "2017-12-31 00:00:00  002396.SZ    6.439913e+09\n",
       "                     002237.SZ    1.343417e+10\n",
       "                     000820.SZ    2.550938e+09\n",
       "                     002776.SZ    2.561272e+09\n",
       "                     600748.SH    3.869392e+10\n",
       "                                      ...     \n",
       "2021-12-31 00:00:00  300325.SZ    2.515615e+09\n",
       "                     002770.SZ    2.414398e+09\n",
       "                     002260.SZ    8.372433e+08\n",
       "                     300178.SZ    4.169976e+09\n",
       "                     300201.SZ    2.329837e+09\n",
       "Name: 总资产, Length: 26879, dtype: float64"
      ]
     },
     "execution_count": 182,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index['总资产']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "id": "1d616538-91c8-414d-baeb-fdb862421460",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Index contains duplicate entries, cannot reshape",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_21112/317148721.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtotal_zcfz_df_index\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'总资产'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0munstack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'股票代码'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mD:\\conda\\lib\\site-packages\\pandas\\core\\series.py\u001b[0m in \u001b[0;36munstack\u001b[1;34m(self, level, fill_value)\u001b[0m\n\u001b[0;32m   4079\u001b[0m         \u001b[1;32mfrom\u001b[0m \u001b[0mpandas\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreshape\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreshape\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0munstack\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4080\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 4081\u001b[1;33m         \u001b[1;32mreturn\u001b[0m \u001b[0munstack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfill_value\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   4082\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4083\u001b[0m     \u001b[1;31m# ----------------------------------------------------------------------\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\conda\\lib\\site-packages\\pandas\\core\\reshape\\reshape.py\u001b[0m in \u001b[0;36munstack\u001b[1;34m(obj, level, fill_value)\u001b[0m\n\u001b[0;32m    458\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mis_1d_only_ea_dtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdtype\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    459\u001b[0m             \u001b[1;32mreturn\u001b[0m \u001b[0m_unstack_extension_series\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfill_value\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 460\u001b[1;33m         unstacker = _Unstacker(\n\u001b[0m\u001b[0;32m    461\u001b[0m             \u001b[0mobj\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlevel\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mconstructor\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_constructor_expanddim\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    462\u001b[0m         )\n",
      "\u001b[1;32mD:\\conda\\lib\\site-packages\\pandas\\core\\reshape\\reshape.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, index, level, constructor)\u001b[0m\n\u001b[0;32m    131\u001b[0m             \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Unstacked DataFrame is too big, causing int32 overflow\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    132\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 133\u001b[1;33m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_make_selectors\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    134\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    135\u001b[0m     \u001b[1;33m@\u001b[0m\u001b[0mcache_readonly\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\conda\\lib\\site-packages\\pandas\\core\\reshape\\reshape.py\u001b[0m in \u001b[0;36m_make_selectors\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m    183\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    184\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mmask\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msum\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m<\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 185\u001b[1;33m             \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Index contains duplicate entries, cannot reshape\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    186\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    187\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgroup_index\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcomp_index\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: Index contains duplicate entries, cannot reshape"
     ]
    }
   ],
   "source": [
    "total_zcfz_df_index['总资产'].unstack('股票代码')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e1d1928f-27ed-4490-b811-c45420a6fcfc",
   "metadata": {},
   "source": [
    "### 重复处理：drop_duplicates"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "baf2569f-ab13-404a-b69d-63dcd5528d6e",
   "metadata": {},
   "source": [
    "起因：可能在输入页码循环获取信息的时候有重复页，其实就是第0页和第1页一样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 184,
   "id": "d3b6e881-38ac-4338-9e2f-067ab1bed629",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(26879,)"
      ]
     },
     "execution_count": 184,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index['总资产'].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 191,
   "id": "688333e5-b060-43ce-be73-6a709d64236b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "公告日期                 股票代码     \n",
       "2017-12-31 00:00:00  002396.SZ    6.439913e+09\n",
       "                     002237.SZ    1.343417e+10\n",
       "                     000820.SZ    2.550938e+09\n",
       "                     002776.SZ    2.561272e+09\n",
       "                     600748.SH    3.869392e+10\n",
       "                                      ...     \n",
       "2021-12-31 00:00:00  300325.SZ    2.515615e+09\n",
       "                     002770.SZ    2.414398e+09\n",
       "                     002260.SZ    8.372433e+08\n",
       "                     300178.SZ    4.169976e+09\n",
       "                     300201.SZ    2.329837e+09\n",
       "Name: 总资产, Length: 24379, dtype: float64"
      ]
     },
     "execution_count": 191,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index['总资产'].drop_duplicates()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "id": "2581faa8-d682-4bac-a70e-cd34c3529581",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "drop_duplicates() got an unexpected keyword argument 'subset'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_21112/1796487419.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtotal_zcfz_df_index\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'总资产'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdrop_duplicates\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msubset\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'公告日期'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'股票代码'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mD:\\conda\\lib\\site-packages\\pandas\\util\\_decorators.py\u001b[0m in \u001b[0;36mwrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m    309\u001b[0m                     \u001b[0mstacklevel\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mstacklevel\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    310\u001b[0m                 )\n\u001b[1;32m--> 311\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    312\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    313\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mwrapper\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: drop_duplicates() got an unexpected keyword argument 'subset'"
     ]
    }
   ],
   "source": [
    "total_zcfz_df_index['总资产'].drop_duplicates(subset=['公告日期', '股票代码'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "id": "1b56e1bf-1abe-4f8c-a909-e9ad93f3e8ed",
   "metadata": {},
   "outputs": [],
   "source": [
    "asset_series = total_zcfz_df_index['总资产']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 194,
   "id": "3355c2ab-3ba3-44e3-967f-0e690ac236fd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "公告日期                 股票代码     \n",
       "2017-12-31 00:00:00  002396.SZ    6.439913e+09\n",
       "                     002237.SZ    1.343417e+10\n",
       "                     000820.SZ    2.550938e+09\n",
       "                     002776.SZ    2.561272e+09\n",
       "                     600748.SH    3.869392e+10\n",
       "                                      ...     \n",
       "2021-12-31 00:00:00  300325.SZ    2.515615e+09\n",
       "                     002770.SZ    2.414398e+09\n",
       "                     002260.SZ    8.372433e+08\n",
       "                     300178.SZ    4.169976e+09\n",
       "                     300201.SZ    2.329837e+09\n",
       "Name: 总资产, Length: 24379, dtype: float64"
      ]
     },
     "execution_count": 194,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "asset_series.drop_duplicates()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "id": "3388fa70-5785-4cbb-ad02-bc94bb5f953f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2500"
      ]
     },
     "execution_count": 186,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "26879 - 24379"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bef82996-05d1-4770-ab29-f57d5ba3e2a6",
   "metadata": {},
   "source": [
    "最准确的写法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "id": "8d3a6fec-983e-4e92-8d70-4b28d213f745",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>公告日期</th>\n",
       "      <th>股票代码</th>\n",
       "      <th>总资产</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002396.SZ</td>\n",
       "      <td>6.439913e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002237.SZ</td>\n",
       "      <td>1.343417e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>000820.SZ</td>\n",
       "      <td>2.550938e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002776.SZ</td>\n",
       "      <td>2.561272e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>600748.SH</td>\n",
       "      <td>3.869392e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26874</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>300325.SZ</td>\n",
       "      <td>2.515615e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26875</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>002770.SZ</td>\n",
       "      <td>2.414398e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26876</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>002260.SZ</td>\n",
       "      <td>8.372433e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26877</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>300178.SZ</td>\n",
       "      <td>4.169976e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26878</th>\n",
       "      <td>2021-12-31 00:00:00</td>\n",
       "      <td>300201.SZ</td>\n",
       "      <td>2.329837e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>24379 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                      公告日期       股票代码           总资产\n",
       "0      2017-12-31 00:00:00  002396.SZ  6.439913e+09\n",
       "1      2017-12-31 00:00:00  002237.SZ  1.343417e+10\n",
       "2      2017-12-31 00:00:00  000820.SZ  2.550938e+09\n",
       "3      2017-12-31 00:00:00  002776.SZ  2.561272e+09\n",
       "4      2017-12-31 00:00:00  600748.SH  3.869392e+10\n",
       "...                    ...        ...           ...\n",
       "26874  2021-12-31 00:00:00  300325.SZ  2.515615e+09\n",
       "26875  2021-12-31 00:00:00  002770.SZ  2.414398e+09\n",
       "26876  2021-12-31 00:00:00  002260.SZ  8.372433e+08\n",
       "26877  2021-12-31 00:00:00  300178.SZ  4.169976e+09\n",
       "26878  2021-12-31 00:00:00  300201.SZ  2.329837e+09\n",
       "\n",
       "[24379 rows x 3 columns]"
      ]
     },
     "execution_count": 197,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index['总资产'].reset_index().drop_duplicates(subset=['公告日期', '股票代码'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 208,
   "id": "65ea9621-615c-4494-9bf5-624b1cfd7239",
   "metadata": {},
   "outputs": [],
   "source": [
    "total_zcfz_df_index_dropdu = total_zcfz_df_index.drop_duplicates()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "id": "cbdf6ae0-b22f-41d6-aa00-11a937946198",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(24379, 11)"
      ]
     },
     "execution_count": 209,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 210,
   "id": "1acc1f1c-f3bc-4ec7-b33f-bcf32bb68f46",
   "metadata": {},
   "outputs": [],
   "source": [
    "total_lrb_df_index_dropdu = total_lrb_df_index.drop_duplicates()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 211,
   "id": "f6ef0d8a-f159-4fc6-98de-e2bc64ec0c7b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(24406, 12)"
      ]
     },
     "execution_count": 211,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_lrb_df_index_dropdu.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d7d5a67c-ce7c-4d31-bbb6-750ba9bbba8f",
   "metadata": {
    "tags": []
   },
   "source": [
    "### 索引的行列转换：unstack"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5b79ea86-66bd-467b-bc55-476941f10a67",
   "metadata": {},
   "source": [
    "靠转置是不可以的"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "id": "d81dff04-d782-4e73-bcc7-04e9f1330364",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "公告日期                 股票代码     \n",
       "2017-12-31 00:00:00  002396.SZ    6.439913e+09\n",
       "                     002237.SZ    1.343417e+10\n",
       "                     000820.SZ    2.550938e+09\n",
       "                     002776.SZ    2.561272e+09\n",
       "                     600748.SH    3.869392e+10\n",
       "                                      ...     \n",
       "2021-12-31 00:00:00  300325.SZ    2.515615e+09\n",
       "                     002770.SZ    2.414398e+09\n",
       "                     002260.SZ    8.372433e+08\n",
       "                     300178.SZ    4.169976e+09\n",
       "                     300201.SZ    2.329837e+09\n",
       "Name: 总资产, Length: 24379, dtype: float64"
      ]
     },
     "execution_count": 213,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu['总资产']"
   ]
  },
  {
   "cell_type": "raw",
   "id": "bfeb29a3-8c88-44e5-a9de-8e65391ca7c7",
   "metadata": {},
   "source": [
    "total_zcfz_df_index_dropdu['总资产'].T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 217,
   "id": "532b8435-d115-4601-91b4-c18a416d226c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>股票代码</th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "      <th>000004.SZ</th>\n",
       "      <th>000005.SZ</th>\n",
       "      <th>000006.SZ</th>\n",
       "      <th>000007.SZ</th>\n",
       "      <th>000008.SZ</th>\n",
       "      <th>000009.SZ</th>\n",
       "      <th>000010.SZ</th>\n",
       "      <th>000011.SZ</th>\n",
       "      <th>...</th>\n",
       "      <th>688787.SH</th>\n",
       "      <th>688788.SH</th>\n",
       "      <th>688789.SH</th>\n",
       "      <th>688793.SH</th>\n",
       "      <th>688798.SH</th>\n",
       "      <th>688799.SH</th>\n",
       "      <th>688800.SH</th>\n",
       "      <th>688819.SH</th>\n",
       "      <th>688981.SH</th>\n",
       "      <th>689009.SH</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公告日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2017-12-31 00:00:00</th>\n",
       "      <td>3.248474e+12</td>\n",
       "      <td>1.165347e+12</td>\n",
       "      <td>2.688443e+08</td>\n",
       "      <td>2.912100e+09</td>\n",
       "      <td>1.313993e+10</td>\n",
       "      <td>4.426756e+08</td>\n",
       "      <td>1.067832e+10</td>\n",
       "      <td>2.710946e+10</td>\n",
       "      <td>3.105153e+09</td>\n",
       "      <td>5.393332e+09</td>\n",
       "      <td>...</td>\n",
       "      <td>1.302400e+08</td>\n",
       "      <td>2.010238e+08</td>\n",
       "      <td>4.292661e+08</td>\n",
       "      <td>1.636509e+08</td>\n",
       "      <td>4.435559e+08</td>\n",
       "      <td>6.263190e+08</td>\n",
       "      <td>7.677596e+08</td>\n",
       "      <td>1.506562e+10</td>\n",
       "      <td>7.792606e+10</td>\n",
       "      <td>1.952104e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-12-31 00:00:00</th>\n",
       "      <td>3.418592e+12</td>\n",
       "      <td>1.528579e+12</td>\n",
       "      <td>3.511775e+08</td>\n",
       "      <td>3.121423e+09</td>\n",
       "      <td>1.353673e+10</td>\n",
       "      <td>5.447100e+08</td>\n",
       "      <td>1.046636e+10</td>\n",
       "      <td>2.984980e+10</td>\n",
       "      <td>3.273278e+09</td>\n",
       "      <td>7.023355e+09</td>\n",
       "      <td>...</td>\n",
       "      <td>2.123277e+08</td>\n",
       "      <td>6.376933e+08</td>\n",
       "      <td>5.533392e+08</td>\n",
       "      <td>2.663177e+08</td>\n",
       "      <td>4.973249e+08</td>\n",
       "      <td>7.320165e+08</td>\n",
       "      <td>8.164974e+08</td>\n",
       "      <td>1.669096e+10</td>\n",
       "      <td>9.884487e+10</td>\n",
       "      <td>3.695630e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-12-31 00:00:00</th>\n",
       "      <td>3.939070e+12</td>\n",
       "      <td>1.729929e+12</td>\n",
       "      <td>1.494490e+09</td>\n",
       "      <td>3.031841e+09</td>\n",
       "      <td>1.574532e+10</td>\n",
       "      <td>5.336934e+08</td>\n",
       "      <td>1.204454e+10</td>\n",
       "      <td>3.020981e+10</td>\n",
       "      <td>4.291660e+09</td>\n",
       "      <td>1.077249e+10</td>\n",
       "      <td>...</td>\n",
       "      <td>4.045394e+08</td>\n",
       "      <td>1.168383e+09</td>\n",
       "      <td>7.256562e+08</td>\n",
       "      <td>3.733668e+08</td>\n",
       "      <td>7.386874e+08</td>\n",
       "      <td>8.514447e+08</td>\n",
       "      <td>8.380431e+08</td>\n",
       "      <td>1.795784e+10</td>\n",
       "      <td>1.148171e+11</td>\n",
       "      <td>3.309293e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-12-31 00:00:00</th>\n",
       "      <td>4.468514e+12</td>\n",
       "      <td>1.869177e+12</td>\n",
       "      <td>1.563563e+09</td>\n",
       "      <td>2.452795e+09</td>\n",
       "      <td>1.543476e+10</td>\n",
       "      <td>3.643940e+08</td>\n",
       "      <td>1.282831e+10</td>\n",
       "      <td>3.185662e+10</td>\n",
       "      <td>3.541730e+09</td>\n",
       "      <td>1.220736e+10</td>\n",
       "      <td>...</td>\n",
       "      <td>4.773500e+08</td>\n",
       "      <td>3.116324e+09</td>\n",
       "      <td>1.026291e+09</td>\n",
       "      <td>4.761995e+08</td>\n",
       "      <td>1.053228e+09</td>\n",
       "      <td>9.211211e+08</td>\n",
       "      <td>9.609821e+08</td>\n",
       "      <td>1.964312e+10</td>\n",
       "      <td>2.046017e+11</td>\n",
       "      <td>6.557638e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-12-31 00:00:00</th>\n",
       "      <td>4.921380e+12</td>\n",
       "      <td>1.938638e+12</td>\n",
       "      <td>1.110570e+09</td>\n",
       "      <td>2.474377e+09</td>\n",
       "      <td>2.360103e+10</td>\n",
       "      <td>4.320155e+08</td>\n",
       "      <td>1.237948e+10</td>\n",
       "      <td>3.707320e+10</td>\n",
       "      <td>4.587491e+09</td>\n",
       "      <td>1.482899e+10</td>\n",
       "      <td>...</td>\n",
       "      <td>8.406634e+08</td>\n",
       "      <td>3.090246e+09</td>\n",
       "      <td>1.827024e+09</td>\n",
       "      <td>9.608764e+08</td>\n",
       "      <td>4.452471e+09</td>\n",
       "      <td>1.797534e+09</td>\n",
       "      <td>1.536878e+09</td>\n",
       "      <td>2.667708e+10</td>\n",
       "      <td>2.299328e+11</td>\n",
       "      <td>7.672446e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 4917 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "股票代码                    000001.SZ     000002.SZ     000004.SZ     000005.SZ  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00  3.248474e+12  1.165347e+12  2.688443e+08  2.912100e+09   \n",
       "2018-12-31 00:00:00  3.418592e+12  1.528579e+12  3.511775e+08  3.121423e+09   \n",
       "2019-12-31 00:00:00  3.939070e+12  1.729929e+12  1.494490e+09  3.031841e+09   \n",
       "2020-12-31 00:00:00  4.468514e+12  1.869177e+12  1.563563e+09  2.452795e+09   \n",
       "2021-12-31 00:00:00  4.921380e+12  1.938638e+12  1.110570e+09  2.474377e+09   \n",
       "\n",
       "股票代码                    000006.SZ     000007.SZ     000008.SZ     000009.SZ  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00  1.313993e+10  4.426756e+08  1.067832e+10  2.710946e+10   \n",
       "2018-12-31 00:00:00  1.353673e+10  5.447100e+08  1.046636e+10  2.984980e+10   \n",
       "2019-12-31 00:00:00  1.574532e+10  5.336934e+08  1.204454e+10  3.020981e+10   \n",
       "2020-12-31 00:00:00  1.543476e+10  3.643940e+08  1.282831e+10  3.185662e+10   \n",
       "2021-12-31 00:00:00  2.360103e+10  4.320155e+08  1.237948e+10  3.707320e+10   \n",
       "\n",
       "股票代码                    000010.SZ     000011.SZ  ...     688787.SH  \\\n",
       "公告日期                                             ...                 \n",
       "2017-12-31 00:00:00  3.105153e+09  5.393332e+09  ...  1.302400e+08   \n",
       "2018-12-31 00:00:00  3.273278e+09  7.023355e+09  ...  2.123277e+08   \n",
       "2019-12-31 00:00:00  4.291660e+09  1.077249e+10  ...  4.045394e+08   \n",
       "2020-12-31 00:00:00  3.541730e+09  1.220736e+10  ...  4.773500e+08   \n",
       "2021-12-31 00:00:00  4.587491e+09  1.482899e+10  ...  8.406634e+08   \n",
       "\n",
       "股票代码                    688788.SH     688789.SH     688793.SH     688798.SH  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00  2.010238e+08  4.292661e+08  1.636509e+08  4.435559e+08   \n",
       "2018-12-31 00:00:00  6.376933e+08  5.533392e+08  2.663177e+08  4.973249e+08   \n",
       "2019-12-31 00:00:00  1.168383e+09  7.256562e+08  3.733668e+08  7.386874e+08   \n",
       "2020-12-31 00:00:00  3.116324e+09  1.026291e+09  4.761995e+08  1.053228e+09   \n",
       "2021-12-31 00:00:00  3.090246e+09  1.827024e+09  9.608764e+08  4.452471e+09   \n",
       "\n",
       "股票代码                    688799.SH     688800.SH     688819.SH     688981.SH  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00  6.263190e+08  7.677596e+08  1.506562e+10  7.792606e+10   \n",
       "2018-12-31 00:00:00  7.320165e+08  8.164974e+08  1.669096e+10  9.884487e+10   \n",
       "2019-12-31 00:00:00  8.514447e+08  8.380431e+08  1.795784e+10  1.148171e+11   \n",
       "2020-12-31 00:00:00  9.211211e+08  9.609821e+08  1.964312e+10  2.046017e+11   \n",
       "2021-12-31 00:00:00  1.797534e+09  1.536878e+09  2.667708e+10  2.299328e+11   \n",
       "\n",
       "股票代码                    689009.SH  \n",
       "公告日期                               \n",
       "2017-12-31 00:00:00  1.952104e+09  \n",
       "2018-12-31 00:00:00  3.695630e+09  \n",
       "2019-12-31 00:00:00  3.309293e+09  \n",
       "2020-12-31 00:00:00  6.557638e+09  \n",
       "2021-12-31 00:00:00  7.672446e+09  \n",
       "\n",
       "[5 rows x 4917 columns]"
      ]
     },
     "execution_count": 217,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu['总资产'].unstack('股票代码')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 219,
   "id": "4403089e-3f64-4424-be4f-01c380d38ec6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>股票代码</th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "      <th>000004.SZ</th>\n",
       "      <th>000005.SZ</th>\n",
       "      <th>000006.SZ</th>\n",
       "      <th>000007.SZ</th>\n",
       "      <th>000008.SZ</th>\n",
       "      <th>000009.SZ</th>\n",
       "      <th>000010.SZ</th>\n",
       "      <th>000011.SZ</th>\n",
       "      <th>...</th>\n",
       "      <th>688787.SH</th>\n",
       "      <th>688788.SH</th>\n",
       "      <th>688789.SH</th>\n",
       "      <th>688793.SH</th>\n",
       "      <th>688798.SH</th>\n",
       "      <th>688799.SH</th>\n",
       "      <th>688800.SH</th>\n",
       "      <th>688819.SH</th>\n",
       "      <th>688981.SH</th>\n",
       "      <th>689009.SH</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公告日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2017-12-31 00:00:00</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-12-31 00:00:00</th>\n",
       "      <td>3.248474e+12</td>\n",
       "      <td>1.165347e+12</td>\n",
       "      <td>2.688443e+08</td>\n",
       "      <td>2.912100e+09</td>\n",
       "      <td>1.313993e+10</td>\n",
       "      <td>4.426756e+08</td>\n",
       "      <td>1.067832e+10</td>\n",
       "      <td>2.710946e+10</td>\n",
       "      <td>3.105153e+09</td>\n",
       "      <td>5.393332e+09</td>\n",
       "      <td>...</td>\n",
       "      <td>1.302400e+08</td>\n",
       "      <td>2.010238e+08</td>\n",
       "      <td>4.292661e+08</td>\n",
       "      <td>1.636509e+08</td>\n",
       "      <td>4.435559e+08</td>\n",
       "      <td>6.263190e+08</td>\n",
       "      <td>7.677596e+08</td>\n",
       "      <td>1.506562e+10</td>\n",
       "      <td>7.792606e+10</td>\n",
       "      <td>1.952104e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-12-31 00:00:00</th>\n",
       "      <td>3.418592e+12</td>\n",
       "      <td>1.528579e+12</td>\n",
       "      <td>3.511775e+08</td>\n",
       "      <td>3.121423e+09</td>\n",
       "      <td>1.353673e+10</td>\n",
       "      <td>5.447100e+08</td>\n",
       "      <td>1.046636e+10</td>\n",
       "      <td>2.984980e+10</td>\n",
       "      <td>3.273278e+09</td>\n",
       "      <td>7.023355e+09</td>\n",
       "      <td>...</td>\n",
       "      <td>2.123277e+08</td>\n",
       "      <td>6.376933e+08</td>\n",
       "      <td>5.533392e+08</td>\n",
       "      <td>2.663177e+08</td>\n",
       "      <td>4.973249e+08</td>\n",
       "      <td>7.320165e+08</td>\n",
       "      <td>8.164974e+08</td>\n",
       "      <td>1.669096e+10</td>\n",
       "      <td>9.884487e+10</td>\n",
       "      <td>3.695630e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-12-31 00:00:00</th>\n",
       "      <td>3.939070e+12</td>\n",
       "      <td>1.729929e+12</td>\n",
       "      <td>1.494490e+09</td>\n",
       "      <td>3.031841e+09</td>\n",
       "      <td>1.574532e+10</td>\n",
       "      <td>5.336934e+08</td>\n",
       "      <td>1.204454e+10</td>\n",
       "      <td>3.020981e+10</td>\n",
       "      <td>4.291660e+09</td>\n",
       "      <td>1.077249e+10</td>\n",
       "      <td>...</td>\n",
       "      <td>4.045394e+08</td>\n",
       "      <td>1.168383e+09</td>\n",
       "      <td>7.256562e+08</td>\n",
       "      <td>3.733668e+08</td>\n",
       "      <td>7.386874e+08</td>\n",
       "      <td>8.514447e+08</td>\n",
       "      <td>8.380431e+08</td>\n",
       "      <td>1.795784e+10</td>\n",
       "      <td>1.148171e+11</td>\n",
       "      <td>3.309293e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-12-31 00:00:00</th>\n",
       "      <td>4.468514e+12</td>\n",
       "      <td>1.869177e+12</td>\n",
       "      <td>1.563563e+09</td>\n",
       "      <td>2.452795e+09</td>\n",
       "      <td>1.543476e+10</td>\n",
       "      <td>3.643940e+08</td>\n",
       "      <td>1.282831e+10</td>\n",
       "      <td>3.185662e+10</td>\n",
       "      <td>3.541730e+09</td>\n",
       "      <td>1.220736e+10</td>\n",
       "      <td>...</td>\n",
       "      <td>4.773500e+08</td>\n",
       "      <td>3.116324e+09</td>\n",
       "      <td>1.026291e+09</td>\n",
       "      <td>4.761995e+08</td>\n",
       "      <td>1.053228e+09</td>\n",
       "      <td>9.211211e+08</td>\n",
       "      <td>9.609821e+08</td>\n",
       "      <td>1.964312e+10</td>\n",
       "      <td>2.046017e+11</td>\n",
       "      <td>6.557638e+09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 4917 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "股票代码                    000001.SZ     000002.SZ     000004.SZ     000005.SZ  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00           NaN           NaN           NaN           NaN   \n",
       "2018-12-31 00:00:00  3.248474e+12  1.165347e+12  2.688443e+08  2.912100e+09   \n",
       "2019-12-31 00:00:00  3.418592e+12  1.528579e+12  3.511775e+08  3.121423e+09   \n",
       "2020-12-31 00:00:00  3.939070e+12  1.729929e+12  1.494490e+09  3.031841e+09   \n",
       "2021-12-31 00:00:00  4.468514e+12  1.869177e+12  1.563563e+09  2.452795e+09   \n",
       "\n",
       "股票代码                    000006.SZ     000007.SZ     000008.SZ     000009.SZ  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00           NaN           NaN           NaN           NaN   \n",
       "2018-12-31 00:00:00  1.313993e+10  4.426756e+08  1.067832e+10  2.710946e+10   \n",
       "2019-12-31 00:00:00  1.353673e+10  5.447100e+08  1.046636e+10  2.984980e+10   \n",
       "2020-12-31 00:00:00  1.574532e+10  5.336934e+08  1.204454e+10  3.020981e+10   \n",
       "2021-12-31 00:00:00  1.543476e+10  3.643940e+08  1.282831e+10  3.185662e+10   \n",
       "\n",
       "股票代码                    000010.SZ     000011.SZ  ...     688787.SH  \\\n",
       "公告日期                                             ...                 \n",
       "2017-12-31 00:00:00           NaN           NaN  ...           NaN   \n",
       "2018-12-31 00:00:00  3.105153e+09  5.393332e+09  ...  1.302400e+08   \n",
       "2019-12-31 00:00:00  3.273278e+09  7.023355e+09  ...  2.123277e+08   \n",
       "2020-12-31 00:00:00  4.291660e+09  1.077249e+10  ...  4.045394e+08   \n",
       "2021-12-31 00:00:00  3.541730e+09  1.220736e+10  ...  4.773500e+08   \n",
       "\n",
       "股票代码                    688788.SH     688789.SH     688793.SH     688798.SH  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00           NaN           NaN           NaN           NaN   \n",
       "2018-12-31 00:00:00  2.010238e+08  4.292661e+08  1.636509e+08  4.435559e+08   \n",
       "2019-12-31 00:00:00  6.376933e+08  5.533392e+08  2.663177e+08  4.973249e+08   \n",
       "2020-12-31 00:00:00  1.168383e+09  7.256562e+08  3.733668e+08  7.386874e+08   \n",
       "2021-12-31 00:00:00  3.116324e+09  1.026291e+09  4.761995e+08  1.053228e+09   \n",
       "\n",
       "股票代码                    688799.SH     688800.SH     688819.SH     688981.SH  \\\n",
       "公告日期                                                                          \n",
       "2017-12-31 00:00:00           NaN           NaN           NaN           NaN   \n",
       "2018-12-31 00:00:00  6.263190e+08  7.677596e+08  1.506562e+10  7.792606e+10   \n",
       "2019-12-31 00:00:00  7.320165e+08  8.164974e+08  1.669096e+10  9.884487e+10   \n",
       "2020-12-31 00:00:00  8.514447e+08  8.380431e+08  1.795784e+10  1.148171e+11   \n",
       "2021-12-31 00:00:00  9.211211e+08  9.609821e+08  1.964312e+10  2.046017e+11   \n",
       "\n",
       "股票代码                    689009.SH  \n",
       "公告日期                               \n",
       "2017-12-31 00:00:00           NaN  \n",
       "2018-12-31 00:00:00  1.952104e+09  \n",
       "2019-12-31 00:00:00  3.695630e+09  \n",
       "2020-12-31 00:00:00  3.309293e+09  \n",
       "2021-12-31 00:00:00  6.557638e+09  \n",
       "\n",
       "[5 rows x 4917 columns]"
      ]
     },
     "execution_count": 219,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu['总资产'].unstack('股票代码').shift(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 221,
   "id": "2c20a439-2d40-4560-b4ee-e00ffa03c544",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "公告日期                 股票代码     \n",
       "2018-12-31 00:00:00  000001.SZ    3.248474e+12\n",
       "                     000002.SZ    1.165347e+12\n",
       "                     000004.SZ    2.688443e+08\n",
       "                     000005.SZ    2.912100e+09\n",
       "                     000006.SZ    1.313993e+10\n",
       "                                      ...     \n",
       "2021-12-31 00:00:00  688799.SH    9.211211e+08\n",
       "                     688800.SH    9.609821e+08\n",
       "                     688819.SH    1.964312e+10\n",
       "                     688981.SH    2.046017e+11\n",
       "                     689009.SH    6.557638e+09\n",
       "Length: 19500, dtype: float64"
      ]
     },
     "execution_count": 221,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu['总资产'].unstack('股票代码').shift(1).stack('股票代码')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 222,
   "id": "2872c8d8-8030-4a7d-850b-ac15706572b1",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\lyf\\AppData\\Local\\Temp/ipykernel_21112/3174964298.py:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  total_zcfz_df_index_dropdu['同期资产'] = total_zcfz_df_index_dropdu['总资产'].unstack('股票代码').shift(1).stack('股票代码')\n"
     ]
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu['同期资产'] = total_zcfz_df_index_dropdu['总资产'].unstack('股票代码').shift(1).stack('股票代码')"
   ]
  },
  {
   "cell_type": "raw",
   "id": "3883b94a-eb7c-4a80-bd3a-e1faa0188648",
   "metadata": {},
   "source": [
    "total_zcfz_df_index_dropdu"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 224,
   "id": "afd4e17b-e86e-463b-9702-a7737af31a1a",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\lyf\\AppData\\Local\\Temp/ipykernel_21112/967660727.py:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  total_zcfz_df_index_dropdu['同期权益'] = total_zcfz_df_index_dropdu['所有者权益'].unstack('股票代码').shift(1).stack('股票代码')\n"
     ]
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu['同期权益'] = total_zcfz_df_index_dropdu['所有者权益'].unstack('股票代码').shift(1).stack('股票代码')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "54ea8bd9-f316-4357-971e-f2ecfb6fb41c",
   "metadata": {},
   "source": [
    "### 数据透视：pivot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 227,
   "id": "2de13c4d-f1df-44d1-beb7-704c7e7cbfc6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>公告日期</th>\n",
       "      <th>股票代码</th>\n",
       "      <th>股票简称</th>\n",
       "      <th>行业名称</th>\n",
       "      <th>总资产</th>\n",
       "      <th>固定资产</th>\n",
       "      <th>货币资金</th>\n",
       "      <th>应收账款</th>\n",
       "      <th>存货</th>\n",
       "      <th>总负债</th>\n",
       "      <th>应付账款</th>\n",
       "      <th>预收账款</th>\n",
       "      <th>所有者权益</th>\n",
       "      <th>同期资产</th>\n",
       "      <th>同期权益</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002396.SZ</td>\n",
       "      <td>星网锐捷</td>\n",
       "      <td>通信设备</td>\n",
       "      <td>6.439913e+09</td>\n",
       "      <td>4.844548e+08</td>\n",
       "      <td>1.731688e+09</td>\n",
       "      <td>1.521677e+09</td>\n",
       "      <td>1.362966e+09</td>\n",
       "      <td>2.690476e+09</td>\n",
       "      <td>9.378150e+08</td>\n",
       "      <td>6.744459e+07</td>\n",
       "      <td>3.749436e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002237.SZ</td>\n",
       "      <td>恒邦股份</td>\n",
       "      <td>贵金属</td>\n",
       "      <td>1.343417e+10</td>\n",
       "      <td>3.613943e+09</td>\n",
       "      <td>1.317289e+09</td>\n",
       "      <td>1.253392e+07</td>\n",
       "      <td>4.846801e+09</td>\n",
       "      <td>8.876205e+09</td>\n",
       "      <td>1.556165e+09</td>\n",
       "      <td>3.274219e+08</td>\n",
       "      <td>4.557968e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>000820.SZ</td>\n",
       "      <td>神雾节能</td>\n",
       "      <td>环保行业</td>\n",
       "      <td>2.550938e+09</td>\n",
       "      <td>9.861318e+06</td>\n",
       "      <td>4.441687e+08</td>\n",
       "      <td>4.164500e+08</td>\n",
       "      <td>2.939347e+08</td>\n",
       "      <td>1.836391e+09</td>\n",
       "      <td>3.333251e+08</td>\n",
       "      <td>8.190880e+07</td>\n",
       "      <td>7.145473e+08</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>002776.SZ</td>\n",
       "      <td>ST柏龙</td>\n",
       "      <td>纺织服装</td>\n",
       "      <td>2.561272e+09</td>\n",
       "      <td>1.512387e+08</td>\n",
       "      <td>1.247969e+09</td>\n",
       "      <td>1.461103e+08</td>\n",
       "      <td>1.060385e+08</td>\n",
       "      <td>6.506575e+08</td>\n",
       "      <td>4.251079e+07</td>\n",
       "      <td>3.698023e+06</td>\n",
       "      <td>1.910615e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2017-12-31 00:00:00</td>\n",
       "      <td>600748.SH</td>\n",
       "      <td>上实发展</td>\n",
       "      <td>房地产开发</td>\n",
       "      <td>3.869392e+10</td>\n",
       "      <td>9.757817e+07</td>\n",
       "      <td>9.410630e+09</td>\n",
       "      <td>1.383166e+09</td>\n",
       "      <td>1.942242e+10</td>\n",
       "      <td>2.756497e+10</td>\n",
       "      <td>1.212087e+09</td>\n",
       "      <td>8.353998e+09</td>\n",
       "      <td>1.112895e+10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                  公告日期       股票代码  股票简称   行业名称           总资产          固定资产  \\\n",
       "0  2017-12-31 00:00:00  002396.SZ  星网锐捷   通信设备  6.439913e+09  4.844548e+08   \n",
       "1  2017-12-31 00:00:00  002237.SZ  恒邦股份    贵金属  1.343417e+10  3.613943e+09   \n",
       "2  2017-12-31 00:00:00  000820.SZ  神雾节能   环保行业  2.550938e+09  9.861318e+06   \n",
       "3  2017-12-31 00:00:00  002776.SZ  ST柏龙   纺织服装  2.561272e+09  1.512387e+08   \n",
       "4  2017-12-31 00:00:00  600748.SH  上实发展  房地产开发  3.869392e+10  9.757817e+07   \n",
       "\n",
       "           货币资金          应收账款            存货           总负债          应付账款  \\\n",
       "0  1.731688e+09  1.521677e+09  1.362966e+09  2.690476e+09  9.378150e+08   \n",
       "1  1.317289e+09  1.253392e+07  4.846801e+09  8.876205e+09  1.556165e+09   \n",
       "2  4.441687e+08  4.164500e+08  2.939347e+08  1.836391e+09  3.333251e+08   \n",
       "3  1.247969e+09  1.461103e+08  1.060385e+08  6.506575e+08  4.251079e+07   \n",
       "4  9.410630e+09  1.383166e+09  1.942242e+10  2.756497e+10  1.212087e+09   \n",
       "\n",
       "           预收账款         所有者权益  同期资产  同期权益  \n",
       "0  6.744459e+07  3.749436e+09   NaN   NaN  \n",
       "1  3.274219e+08  4.557968e+09   NaN   NaN  \n",
       "2  8.190880e+07  7.145473e+08   NaN   NaN  \n",
       "3  3.698023e+06  1.910615e+09   NaN   NaN  \n",
       "4  8.353998e+09  1.112895e+10   NaN   NaN  "
      ]
     },
     "execution_count": 227,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu.reset_index().head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 229,
   "id": "900a7cce-b61c-45d1-a5a7-afc4a603650f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>股票代码</th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "      <th>000004.SZ</th>\n",
       "      <th>000005.SZ</th>\n",
       "      <th>000006.SZ</th>\n",
       "      <th>000007.SZ</th>\n",
       "      <th>000008.SZ</th>\n",
       "      <th>000009.SZ</th>\n",
       "      <th>000010.SZ</th>\n",
       "      <th>000011.SZ</th>\n",
       "      <th>...</th>\n",
       "      <th>688787.SH</th>\n",
       "      <th>688788.SH</th>\n",
       "      <th>688789.SH</th>\n",
       "      <th>688793.SH</th>\n",
       "      <th>688798.SH</th>\n",
       "      <th>688799.SH</th>\n",
       "      <th>688800.SH</th>\n",
       "      <th>688819.SH</th>\n",
       "      <th>688981.SH</th>\n",
       "      <th>689009.SH</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公告日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2017-12-31 00:00:00</th>\n",
       "      <td>NaN</td>\n",
       "      <td>7.098808e+09</td>\n",
       "      <td>31220863.80</td>\n",
       "      <td>32886986.27</td>\n",
       "      <td>2928689.07</td>\n",
       "      <td>69828221.54</td>\n",
       "      <td>2.450931e+08</td>\n",
       "      <td>3.714895e+09</td>\n",
       "      <td>62794410.60</td>\n",
       "      <td>2.934690e+07</td>\n",
       "      <td>...</td>\n",
       "      <td>2192009.29</td>\n",
       "      <td>5466242.55</td>\n",
       "      <td>78790450.82</td>\n",
       "      <td>11601637.55</td>\n",
       "      <td>9.910288e+07</td>\n",
       "      <td>3.435797e+08</td>\n",
       "      <td>1.336948e+08</td>\n",
       "      <td>3.846080e+09</td>\n",
       "      <td>3.057225e+10</td>\n",
       "      <td>5.922205e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-12-31 00:00:00</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1.153380e+10</td>\n",
       "      <td>990258.43</td>\n",
       "      <td>28128321.35</td>\n",
       "      <td>6677730.19</td>\n",
       "      <td>66456511.05</td>\n",
       "      <td>3.078395e+08</td>\n",
       "      <td>4.184108e+09</td>\n",
       "      <td>71030184.83</td>\n",
       "      <td>1.025170e+08</td>\n",
       "      <td>...</td>\n",
       "      <td>25787732.29</td>\n",
       "      <td>7389550.54</td>\n",
       "      <td>77617634.65</td>\n",
       "      <td>12882261.83</td>\n",
       "      <td>1.598711e+08</td>\n",
       "      <td>3.711053e+08</td>\n",
       "      <td>1.602191e+08</td>\n",
       "      <td>3.849908e+09</td>\n",
       "      <td>3.119536e+10</td>\n",
       "      <td>6.610298e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-12-31 00:00:00</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1.239984e+10</td>\n",
       "      <td>2229822.41</td>\n",
       "      <td>30808639.13</td>\n",
       "      <td>13144374.38</td>\n",
       "      <td>60078260.28</td>\n",
       "      <td>4.438267e+08</td>\n",
       "      <td>4.663303e+09</td>\n",
       "      <td>44091955.90</td>\n",
       "      <td>9.355778e+07</td>\n",
       "      <td>...</td>\n",
       "      <td>24811531.16</td>\n",
       "      <td>12322953.08</td>\n",
       "      <td>92524473.45</td>\n",
       "      <td>17334319.40</td>\n",
       "      <td>1.910530e+08</td>\n",
       "      <td>3.600883e+08</td>\n",
       "      <td>1.574079e+08</td>\n",
       "      <td>4.219621e+09</td>\n",
       "      <td>3.686612e+10</td>\n",
       "      <td>1.041252e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-12-31 00:00:00</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1.257734e+10</td>\n",
       "      <td>1992164.59</td>\n",
       "      <td>28262377.21</td>\n",
       "      <td>44081034.37</td>\n",
       "      <td>46220623.87</td>\n",
       "      <td>4.505120e+08</td>\n",
       "      <td>4.599721e+09</td>\n",
       "      <td>22823798.32</td>\n",
       "      <td>1.162339e+08</td>\n",
       "      <td>...</td>\n",
       "      <td>23573225.28</td>\n",
       "      <td>20369197.81</td>\n",
       "      <td>86419707.13</td>\n",
       "      <td>14954844.51</td>\n",
       "      <td>2.748446e+08</td>\n",
       "      <td>3.936599e+08</td>\n",
       "      <td>1.366550e+08</td>\n",
       "      <td>4.311153e+09</td>\n",
       "      <td>5.141500e+10</td>\n",
       "      <td>4.893379e+08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-12-31 00:00:00</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1.282106e+10</td>\n",
       "      <td>2446998.74</td>\n",
       "      <td>25993036.39</td>\n",
       "      <td>42478976.98</td>\n",
       "      <td>46728899.22</td>\n",
       "      <td>4.126602e+08</td>\n",
       "      <td>4.928474e+09</td>\n",
       "      <td>18416480.53</td>\n",
       "      <td>1.141556e+08</td>\n",
       "      <td>...</td>\n",
       "      <td>24724986.09</td>\n",
       "      <td>24959231.54</td>\n",
       "      <td>77358707.29</td>\n",
       "      <td>17386997.05</td>\n",
       "      <td>4.405497e+08</td>\n",
       "      <td>4.299284e+08</td>\n",
       "      <td>1.515493e+08</td>\n",
       "      <td>4.646088e+09</td>\n",
       "      <td>6.536643e+10</td>\n",
       "      <td>5.894623e+08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 4917 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "股票代码                 000001.SZ     000002.SZ    000004.SZ    000005.SZ  \\\n",
       "公告日期                                                                     \n",
       "2017-12-31 00:00:00        NaN  7.098808e+09  31220863.80  32886986.27   \n",
       "2018-12-31 00:00:00        NaN  1.153380e+10    990258.43  28128321.35   \n",
       "2019-12-31 00:00:00        NaN  1.239984e+10   2229822.41  30808639.13   \n",
       "2020-12-31 00:00:00        NaN  1.257734e+10   1992164.59  28262377.21   \n",
       "2021-12-31 00:00:00        NaN  1.282106e+10   2446998.74  25993036.39   \n",
       "\n",
       "股票代码                   000006.SZ    000007.SZ     000008.SZ     000009.SZ  \\\n",
       "公告日期                                                                        \n",
       "2017-12-31 00:00:00   2928689.07  69828221.54  2.450931e+08  3.714895e+09   \n",
       "2018-12-31 00:00:00   6677730.19  66456511.05  3.078395e+08  4.184108e+09   \n",
       "2019-12-31 00:00:00  13144374.38  60078260.28  4.438267e+08  4.663303e+09   \n",
       "2020-12-31 00:00:00  44081034.37  46220623.87  4.505120e+08  4.599721e+09   \n",
       "2021-12-31 00:00:00  42478976.98  46728899.22  4.126602e+08  4.928474e+09   \n",
       "\n",
       "股票代码                   000010.SZ     000011.SZ  ...    688787.SH    688788.SH  \\\n",
       "公告日期                                            ...                             \n",
       "2017-12-31 00:00:00  62794410.60  2.934690e+07  ...   2192009.29   5466242.55   \n",
       "2018-12-31 00:00:00  71030184.83  1.025170e+08  ...  25787732.29   7389550.54   \n",
       "2019-12-31 00:00:00  44091955.90  9.355778e+07  ...  24811531.16  12322953.08   \n",
       "2020-12-31 00:00:00  22823798.32  1.162339e+08  ...  23573225.28  20369197.81   \n",
       "2021-12-31 00:00:00  18416480.53  1.141556e+08  ...  24724986.09  24959231.54   \n",
       "\n",
       "股票代码                   688789.SH    688793.SH     688798.SH     688799.SH  \\\n",
       "公告日期                                                                        \n",
       "2017-12-31 00:00:00  78790450.82  11601637.55  9.910288e+07  3.435797e+08   \n",
       "2018-12-31 00:00:00  77617634.65  12882261.83  1.598711e+08  3.711053e+08   \n",
       "2019-12-31 00:00:00  92524473.45  17334319.40  1.910530e+08  3.600883e+08   \n",
       "2020-12-31 00:00:00  86419707.13  14954844.51  2.748446e+08  3.936599e+08   \n",
       "2021-12-31 00:00:00  77358707.29  17386997.05  4.405497e+08  4.299284e+08   \n",
       "\n",
       "股票代码                    688800.SH     688819.SH     688981.SH     689009.SH  \n",
       "公告日期                                                                         \n",
       "2017-12-31 00:00:00  1.336948e+08  3.846080e+09  3.057225e+10  5.922205e+07  \n",
       "2018-12-31 00:00:00  1.602191e+08  3.849908e+09  3.119536e+10  6.610298e+07  \n",
       "2019-12-31 00:00:00  1.574079e+08  4.219621e+09  3.686612e+10  1.041252e+08  \n",
       "2020-12-31 00:00:00  1.366550e+08  4.311153e+09  5.141500e+10  4.893379e+08  \n",
       "2021-12-31 00:00:00  1.515493e+08  4.646088e+09  6.536643e+10  5.894623e+08  \n",
       "\n",
       "[5 rows x 4917 columns]"
      ]
     },
     "execution_count": 229,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu.reset_index().pivot(index='公告日期', columns='股票代码', values='固定资产')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "96c62cea-a55b-42c2-8d85-b51f176d33bd",
   "metadata": {},
   "source": [
    "## 真正的计算"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "763fa7a9-0ec0-41c4-9552-ef13e6f36f62",
   "metadata": {},
   "source": [
    "### 补充净利润"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b62a0b7b-04f0-4bef-bf06-925d6a9e488a",
   "metadata": {},
   "source": [
    "净利润数据数据有缺失"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 232,
   "id": "7e97bf51-8717-404a-babe-ef19f77a6dd2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "24166"
      ]
     },
     "execution_count": 232,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_lrb_df_index_dropdu['净利润'].isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 235,
   "id": "5b5cc67d-ba37-473c-935c-94649018b735",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\lyf\\AppData\\Local\\Temp/ipykernel_21112/3616160984.py:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  total_lrb_df_index_dropdu['净利润'] = total_lrb_df_index_dropdu['利润总额'] - total_lrb_df_index_dropdu['所得税费用']\n"
     ]
    }
   ],
   "source": [
    "total_lrb_df_index_dropdu['净利润'] = total_lrb_df_index_dropdu['利润总额'] - total_lrb_df_index_dropdu['所得税费用']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 236,
   "id": "07485c7b-719b-433e-afbd-6701ee112445",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "262"
      ]
     },
     "execution_count": 236,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_lrb_df_index_dropdu['净利润'].isnull().sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "272cab6e-28a0-42bc-a2ec-bd0bfb30a9e0",
   "metadata": {},
   "source": [
    "### ROE计算对比"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "afd2405e-9563-4924-bc04-12aad61ceb8f",
   "metadata": {},
   "source": [
    "杜邦分析：https://emweb.securities.eastmoney.com/PC_HSF10/FinanceAnalysis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 238,
   "id": "b4ba74dc-255b-4669-802e-e4dd1b82cce8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "公告日期                 股票代码     \n",
       "2017-12-31 00:00:00  000001.SZ         NaN\n",
       "                     000002.SZ         NaN\n",
       "                     000004.SZ         NaN\n",
       "                     000005.SZ         NaN\n",
       "                     000006.SZ         NaN\n",
       "                                    ...   \n",
       "2021-12-31 00:00:00  688799.SH    0.150067\n",
       "                     688800.SH    0.148570\n",
       "                     688819.SH    0.133372\n",
       "                     688981.SH    0.073795\n",
       "                     689009.SH    0.102388\n",
       "Length: 24412, dtype: float64"
      ]
     },
     "execution_count": 238,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_lrb_df_index_dropdu['净利润'] / (total_zcfz_df_index_dropdu['所有者权益'] + total_zcfz_df_index_dropdu['同期权益']) * 2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4e95a07e-ac82-4a0e-a9e5-da8df33e11ec",
   "metadata": {},
   "source": [
    "https://emweb.securities.eastmoney.com/PC_HSF10/FinanceAnalysis/Index?type=web&code=SH689009#dbfx-0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 239,
   "id": "ad740a90-c331-40ac-8f27-e23fbbbe62f8",
   "metadata": {},
   "outputs": [],
   "source": [
    "code = '689009.SH'\n",
    "report_date = '2021-12-31 00:00:00'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 240,
   "id": "a4b80d10-203c-49bd-8f80-48cfcb785c59",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "股票简称                  九号公司\n",
       "行业名称                  交运设备\n",
       "营业收入         9146053585.08\n",
       "营业成本         7021787925.51\n",
       "销售费用          592434881.14\n",
       "管理费用           520239557.5\n",
       "财务费用           99420496.95\n",
       "营业总支出    8773603139.549999\n",
       "营业利润          510751407.75\n",
       "利润总额          499620323.72\n",
       "所得税费用          91619616.18\n",
       "净利润           408000707.54\n",
       "Name: 689009.SH, dtype: object"
      ]
     },
     "execution_count": 240,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_lrb_df_index_dropdu.loc[report_date].loc[code]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 241,
   "id": "0e747e54-45cf-4ebb-a1f7-6e7c5f1a327b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "股票简称              九号公司\n",
       "行业名称              交运设备\n",
       "总资产       7672446491.2\n",
       "固定资产      589462328.82\n",
       "货币资金     1726091997.43\n",
       "应收账款      770937361.74\n",
       "存货       2383256794.58\n",
       "总负债      3399555413.77\n",
       "应付账款     1931447866.55\n",
       "预收账款               NaN\n",
       "所有者权益    4272891077.43\n",
       "同期资产     6557637541.93\n",
       "同期权益     3696778410.72\n",
       "Name: 689009.SH, dtype: object"
      ]
     },
     "execution_count": 241,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_zcfz_df_index_dropdu.loc[report_date].loc[code]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ee53be47-3547-4e1c-b6f5-62915bf21390",
   "metadata": {},
   "source": [
    "### 三项分拆查看"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b0062215-0d13-4140-be66-08efc52ada7c",
   "metadata": {},
   "source": [
    "利润率 = 净利润 / 营业总收入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 242,
   "id": "e9e644fa-e57e-422b-87ed-d9550b85840d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.04460948142765897"
      ]
     },
     "execution_count": 242,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "408000707.54 / 9146053585.08 "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c9a3c9f7-eb92-4c05-9d1f-b97e708aa348",
   "metadata": {},
   "source": [
    "资产周转率 = 营业收入 / 资产"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 243,
   "id": "cc5b6342-4788-4afd-b6a0-97f362e66cf7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.2854532079763503"
      ]
     },
     "execution_count": 243,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "9146053585.08  / (7672446491.2 + 6557637541.93) * 2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b2a3b2cf-e08e-4325-940e-c3361bb4b1c7",
   "metadata": {},
   "source": [
    "权益乘数 = 资产 / 所有者权益"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 244,
   "id": "cf15b3a0-4529-481c-8eb0-16d3a59de9e8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.7956101272337412"
      ]
     },
     "execution_count": 244,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "7672446491.2 / 4272891077.43"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "408aaadd-cd89-423e-a954-b0acf76d1ce4",
   "metadata": {},
   "source": [
    "## 一个大合并"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 245,
   "id": "5306e822-e415-46a2-af6d-291fc24f2021",
   "metadata": {},
   "outputs": [],
   "source": [
    "total_df = pd.concat([total_zcfz_df_index_dropdu, total_lrb_df_index_dropdu], axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 246,
   "id": "f78d3b8b-863b-4fe1-9ad0-be991bf71b0f",
   "metadata": {},
   "outputs": [],
   "source": [
    "total_df['净资产收益率'] = total_df['净利润'] / (total_df['所有者权益'] + total_df['同期权益']) * 2\n",
    "total_df['利润率'] = total_df['净利润'] / total_df['营业收入']\n",
    "total_df['资产周转率'] = total_df['营业收入'] / (total_df['总资产'] + total_df['同期资产']) * 2\n",
    "total_df['权益乘数'] = total_df['总资产'] / total_df['所有者权益']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4a0f8da4-ebcf-4a62-b07b-ab3f3e99023a",
   "metadata": {},
   "source": [
    "银行没有营业收入！"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 247,
   "id": "ce12c048-4e60-4fbb-933a-ae5f93e71521",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "股票简称                   九号公司\n",
       "行业名称                   交运设备\n",
       "总资产            7672446491.2\n",
       "固定资产           589462328.82\n",
       "货币资金          1726091997.43\n",
       "应收账款           770937361.74\n",
       "存货            2383256794.58\n",
       "总负债           3399555413.77\n",
       "应付账款          1931447866.55\n",
       "预收账款                    NaN\n",
       "所有者权益         4272891077.43\n",
       "同期资产          6557637541.93\n",
       "同期权益          3696778410.72\n",
       "股票简称                   九号公司\n",
       "行业名称                   交运设备\n",
       "营业收入          9146053585.08\n",
       "营业成本          7021787925.51\n",
       "销售费用           592434881.14\n",
       "管理费用            520239557.5\n",
       "财务费用            99420496.95\n",
       "营业总支出     8773603139.549999\n",
       "营业利润           510751407.75\n",
       "利润总额           499620323.72\n",
       "所得税费用           91619616.18\n",
       "净利润            408000707.54\n",
       "净资产收益率             0.102388\n",
       "利润率                0.044609\n",
       "资产周转率              1.285453\n",
       "权益乘数                1.79561\n",
       "Name: 689009.SH, dtype: object"
      ]
     },
     "execution_count": 247,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_df.loc['2021-12-31 00:00:00'].loc['689009.SH']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9ccbfbf3-9ac2-483f-8f52-fd0b108fde3c",
   "metadata": {},
   "source": [
    "# 截面可视化分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 249,
   "id": "6b9b42e1-cc84-4059-ada9-e9607d06c0c2",
   "metadata": {},
   "outputs": [],
   "source": [
    "analysis_df = total_df.loc['2021-12-31 00:00:00']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "be7cfc77-a58f-4d6a-86bb-f7ed9991bf26",
   "metadata": {},
   "source": [
    "## 缺失值统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 250,
   "id": "0f2ea120-fd22-40a2-8a6d-c36f58aab326",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "股票代码\n",
       "000001.SZ    0.095674\n",
       "000002.SZ    0.102528\n",
       "000004.SZ   -0.422918\n",
       "000005.SZ    0.099576\n",
       "000006.SZ    0.069090\n",
       "               ...   \n",
       "688799.SH    0.150067\n",
       "688800.SH    0.148570\n",
       "688819.SH    0.133372\n",
       "688981.SH    0.073795\n",
       "689009.SH    0.102388\n",
       "Name: 净资产收益率, Length: 4911, dtype: float64"
      ]
     },
     "execution_count": 250,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df['净资产收益率']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 251,
   "id": "82602908-379d-4344-9307-decd6f440c0c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "69"
      ]
     },
     "execution_count": 251,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df['净资产收益率'].isnull().sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e1d2dc96-e0f3-43a6-bf8a-8423744ade57",
   "metadata": {},
   "source": [
    "存在缺失值，但是不多"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 252,
   "id": "53d727fa-c014-4d36-95dc-77b67c659c9b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>净资产收益率</th>\n",
       "      <th>利润率</th>\n",
       "      <th>资产周转率</th>\n",
       "      <th>权益乘数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>4842.000000</td>\n",
       "      <td>4872.000000</td>\n",
       "      <td>4877.000000</td>\n",
       "      <td>4879.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>0.035385</td>\n",
       "      <td>-10.658341</td>\n",
       "      <td>0.661804</td>\n",
       "      <td>2.388081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1.685564</td>\n",
       "      <td>735.811340</td>\n",
       "      <td>0.550507</td>\n",
       "      <td>5.182701</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>-73.540670</td>\n",
       "      <td>-51356.378095</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-52.947578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>0.030101</td>\n",
       "      <td>0.024555</td>\n",
       "      <td>0.361496</td>\n",
       "      <td>1.336325</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>0.084256</td>\n",
       "      <td>0.080664</td>\n",
       "      <td>0.561562</td>\n",
       "      <td>1.687911</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>0.143000</td>\n",
       "      <td>0.157122</td>\n",
       "      <td>0.812827</td>\n",
       "      <td>2.301894</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>24.264648</td>\n",
       "      <td>16.741226</td>\n",
       "      <td>11.452938</td>\n",
       "      <td>276.340096</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            净资产收益率           利润率        资产周转率         权益乘数\n",
       "count  4842.000000   4872.000000  4877.000000  4879.000000\n",
       "mean      0.035385    -10.658341     0.661804     2.388081\n",
       "std       1.685564    735.811340     0.550507     5.182701\n",
       "min     -73.540670 -51356.378095     0.000000   -52.947578\n",
       "25%       0.030101      0.024555     0.361496     1.336325\n",
       "50%       0.084256      0.080664     0.561562     1.687911\n",
       "75%       0.143000      0.157122     0.812827     2.301894\n",
       "max      24.264648     16.741226    11.452938   276.340096"
      ]
     },
     "execution_count": 252,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df.loc[:, ['净资产收益率', '利润率', '资产周转率', '权益乘数']].describe() "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6190c223-e1ca-4c13-9f18-d99fc972e23a",
   "metadata": {},
   "source": [
    "## 重复索引处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 254,
   "id": "68f66783-e5bf-43ff-82aa-cbf4d1526f2c",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Grouper for '行业名称' not 1-dimensional",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_21112/2660899348.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m analysis_df.groupby('行业名称').agg({\n\u001b[0m\u001b[0;32m      2\u001b[0m     \u001b[1;34m'净资产收益率'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;34m'mean'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m     \u001b[1;34m'利润率'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;34m'mean'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[1;34m'资产周转率'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;34m'mean'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m     \u001b[1;34m'权益乘数'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;34m'mean'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\conda\\lib\\site-packages\\pandas\\core\\frame.py\u001b[0m in \u001b[0;36mgroupby\u001b[1;34m(self, by, axis, level, as_index, sort, group_keys, squeeze, observed, dropna)\u001b[0m\n\u001b[0;32m   7629\u001b[0m         \u001b[1;31m# error: Argument \"squeeze\" to \"DataFrameGroupBy\" has incompatible type\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   7630\u001b[0m         \u001b[1;31m# \"Union[bool, NoDefault]\"; expected \"bool\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 7631\u001b[1;33m         return DataFrameGroupBy(\n\u001b[0m\u001b[0;32m   7632\u001b[0m             \u001b[0mobj\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   7633\u001b[0m             \u001b[0mkeys\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mby\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\conda\\lib\\site-packages\\pandas\\core\\groupby\\groupby.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, obj, keys, axis, level, grouper, exclusions, selection, as_index, sort, group_keys, squeeze, observed, mutated, dropna)\u001b[0m\n\u001b[0;32m    887\u001b[0m             \u001b[1;32mfrom\u001b[0m \u001b[0mpandas\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgroupby\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgrouper\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mget_grouper\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    888\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 889\u001b[1;33m             grouper, exclusions, obj = get_grouper(\n\u001b[0m\u001b[0;32m    890\u001b[0m                 \u001b[0mobj\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    891\u001b[0m                 \u001b[0mkeys\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\conda\\lib\\site-packages\\pandas\\core\\groupby\\grouper.py\u001b[0m in \u001b[0;36mget_grouper\u001b[1;34m(obj, key, axis, level, sort, observed, mutated, validate, dropna)\u001b[0m\n\u001b[0;32m    855\u001b[0m                     \u001b[1;31m# non-unique columns; raise here to get the name in the\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    856\u001b[0m                     \u001b[1;31m# exception message\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 857\u001b[1;33m                     \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34mf\"Grouper for '{name}' not 1-dimensional\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    858\u001b[0m                 \u001b[0mexclusions\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    859\u001b[0m             \u001b[1;32melif\u001b[0m \u001b[0mobj\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_is_level_reference\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mgpr\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: Grouper for '行业名称' not 1-dimensional"
     ]
    }
   ],
   "source": [
    "analysis_df.groupby('行业名称').agg({\n",
    "    '净资产收益率': 'mean',\n",
    "    '利润率': 'mean',            \n",
    "    '资产周转率': 'mean',  \n",
    "    '权益乘数': 'mean',  \n",
    "})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 255,
   "id": "def46425-328f-4f0c-9cae-94b3dc178533",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['股票简称', '行业名称', '总资产', '固定资产', '货币资金', '应收账款', '存货', '总负债', '应付账款',\n",
       "       '预收账款', '所有者权益', '同期资产', '同期权益', '股票简称', '行业名称', '营业收入', '营业成本', '销售费用',\n",
       "       '管理费用', '财务费用', '营业总支出', '营业利润', '利润总额', '所得税费用', '净利润', '净资产收益率',\n",
       "       '利润率', '资产周转率', '权益乘数'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 255,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 256,
   "id": "ee79355f-c2a6-4928-8e00-346833e151f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['股票简称', '总资产', '固定资产', '货币资金', '应收账款', '存货', '总负债', '应付账款', '预收账款',\n",
       "       '所有者权益', '同期资产', '同期权益', '股票简称', '营业收入', '营业成本', '销售费用', '管理费用', '财务费用',\n",
       "       '营业总支出', '营业利润', '利润总额', '所得税费用', '净利润', '净资产收益率', '利润率', '资产周转率',\n",
       "       '权益乘数'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 256,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df.drop(columns='行业名称').columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 258,
   "id": "c37279cc-cf13-4453-b4d1-fccaaae542c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "股票代码\n",
       "000001.SZ       银行\n",
       "000002.SZ    房地产开发\n",
       "000004.SZ     软件开发\n",
       "000005.SZ     环保行业\n",
       "000006.SZ    房地产开发\n",
       "             ...  \n",
       "688799.SH     化学制药\n",
       "688800.SH     电子元件\n",
       "688819.SH       电池\n",
       "688981.SH      半导体\n",
       "689009.SH     交运设备\n",
       "Name: 行业名称, Length: 4911, dtype: object"
      ]
     },
     "execution_count": 258,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df['行业名称'].iloc[:, 0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 260,
   "id": "f311c34b-6b43-49c8-b289-84453541ed08",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\lyf\\AppData\\Local\\Temp/ipykernel_21112/3252943791.py:3: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  analysis_df['行业名称'] = hymc\n"
     ]
    }
   ],
   "source": [
    "hymc = analysis_df['行业名称'].iloc[:, 0].copy()\n",
    "analysis_df = analysis_df.drop(columns='行业名称')\n",
    "analysis_df['行业名称'] = hymc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 261,
   "id": "e0b51974-6ee4-4f70-b7d8-c3a0fa2e244b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['股票简称', '总资产', '固定资产', '货币资金', '应收账款', '存货', '总负债', '应付账款', '预收账款',\n",
       "       '所有者权益', '同期资产', '同期权益', '股票简称', '营业收入', '营业成本', '销售费用', '管理费用', '财务费用',\n",
       "       '营业总支出', '营业利润', '利润总额', '所得税费用', '净利润', '净资产收益率', '利润率', '资产周转率',\n",
       "       '权益乘数', '行业名称'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 261,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analysis_df.columns"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "abcb63ae-8541-4b0a-b545-6622b0a3fbd5",
   "metadata": {},
   "source": [
    "## 行业聚合"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 262,
   "id": "cc0f6837-7cad-4c29-a7b8-ffa30049693c",
   "metadata": {},
   "outputs": [],
   "source": [
    "industry_df = analysis_df.groupby('行业名称').agg({\n",
    "    '净资产收益率': 'mean',\n",
    "    '利润率': 'mean',            \n",
    "    '资产周转率': 'mean',  \n",
    "    '权益乘数': 'mean',  \n",
    "                                     })"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 263,
   "id": "27a510eb-2803-4308-b08b-74f1d27e3d28",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>净资产收益率</th>\n",
       "      <th>利润率</th>\n",
       "      <th>资产周转率</th>\n",
       "      <th>权益乘数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>专业服务</th>\n",
       "      <td>0.106251</td>\n",
       "      <td>0.168984</td>\n",
       "      <td>0.546724</td>\n",
       "      <td>1.860796</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>专用设备</th>\n",
       "      <td>0.061328</td>\n",
       "      <td>0.066711</td>\n",
       "      <td>0.563403</td>\n",
       "      <td>2.009699</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>中药</th>\n",
       "      <td>-0.407737</td>\n",
       "      <td>0.044986</td>\n",
       "      <td>0.564092</td>\n",
       "      <td>1.523184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>互联网服务</th>\n",
       "      <td>0.037983</td>\n",
       "      <td>-0.055142</td>\n",
       "      <td>0.619966</td>\n",
       "      <td>3.981657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>交运设备</th>\n",
       "      <td>0.076309</td>\n",
       "      <td>0.076489</td>\n",
       "      <td>0.658983</td>\n",
       "      <td>1.792859</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>铁路公路</th>\n",
       "      <td>0.080429</td>\n",
       "      <td>0.344942</td>\n",
       "      <td>0.239865</td>\n",
       "      <td>2.132222</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>银行</th>\n",
       "      <td>0.104388</td>\n",
       "      <td>0.325553</td>\n",
       "      <td>0.025543</td>\n",
       "      <td>12.528014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>非金属材料</th>\n",
       "      <td>0.180088</td>\n",
       "      <td>0.391918</td>\n",
       "      <td>0.552968</td>\n",
       "      <td>1.650144</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>风电设备</th>\n",
       "      <td>0.150851</td>\n",
       "      <td>0.113657</td>\n",
       "      <td>0.589081</td>\n",
       "      <td>2.671248</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>食品饮料</th>\n",
       "      <td>0.095698</td>\n",
       "      <td>0.075522</td>\n",
       "      <td>0.899137</td>\n",
       "      <td>1.865842</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         净资产收益率       利润率     资产周转率       权益乘数\n",
       "行业名称                                          \n",
       "专业服务   0.106251  0.168984  0.546724   1.860796\n",
       "专用设备   0.061328  0.066711  0.563403   2.009699\n",
       "中药    -0.407737  0.044986  0.564092   1.523184\n",
       "互联网服务  0.037983 -0.055142  0.619966   3.981657\n",
       "交运设备   0.076309  0.076489  0.658983   1.792859\n",
       "...         ...       ...       ...        ...\n",
       "铁路公路   0.080429  0.344942  0.239865   2.132222\n",
       "银行     0.104388  0.325553  0.025543  12.528014\n",
       "非金属材料  0.180088  0.391918  0.552968   1.650144\n",
       "风电设备   0.150851  0.113657  0.589081   2.671248\n",
       "食品饮料   0.095698  0.075522  0.899137   1.865842\n",
       "\n",
       "[86 rows x 4 columns]"
      ]
     },
     "execution_count": 263,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "industry_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d7e22510-7d9e-44bf-b4ca-22c099302e7c",
   "metadata": {},
   "source": [
    "### 净资产收益率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 264,
   "id": "90f9d811-0a77-4081-831a-465c745fa2ed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>净资产收益率</th>\n",
       "      <th>利润率</th>\n",
       "      <th>资产周转率</th>\n",
       "      <th>权益乘数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>医疗服务</th>\n",
       "      <td>-1.577918</td>\n",
       "      <td>0.031912</td>\n",
       "      <td>0.550014</td>\n",
       "      <td>3.259248</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>珠宝首饰</th>\n",
       "      <td>-1.320080</td>\n",
       "      <td>-0.825025</td>\n",
       "      <td>1.255139</td>\n",
       "      <td>2.608229</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>电子元件</th>\n",
       "      <td>-0.552516</td>\n",
       "      <td>0.112155</td>\n",
       "      <td>0.744475</td>\n",
       "      <td>1.567169</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>房地产服务</th>\n",
       "      <td>-0.421037</td>\n",
       "      <td>-0.025753</td>\n",
       "      <td>0.586678</td>\n",
       "      <td>3.109428</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>中药</th>\n",
       "      <td>-0.407737</td>\n",
       "      <td>0.044986</td>\n",
       "      <td>0.564092</td>\n",
       "      <td>1.523184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>贵金属</th>\n",
       "      <td>-0.371735</td>\n",
       "      <td>0.005601</td>\n",
       "      <td>1.102198</td>\n",
       "      <td>0.961012</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>装修装饰</th>\n",
       "      <td>-0.200472</td>\n",
       "      <td>-0.145458</td>\n",
       "      <td>0.618859</td>\n",
       "      <td>3.702802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>多元金融</th>\n",
       "      <td>-0.135020</td>\n",
       "      <td>-0.879302</td>\n",
       "      <td>0.180284</td>\n",
       "      <td>4.169069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>教育</th>\n",
       "      <td>-0.127962</td>\n",
       "      <td>-0.518374</td>\n",
       "      <td>0.388277</td>\n",
       "      <td>7.301889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>通信服务</th>\n",
       "      <td>-0.115475</td>\n",
       "      <td>-0.179684</td>\n",
       "      <td>0.618240</td>\n",
       "      <td>2.029962</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         净资产收益率       利润率     资产周转率      权益乘数\n",
       "行业名称                                         \n",
       "医疗服务  -1.577918  0.031912  0.550014  3.259248\n",
       "珠宝首饰  -1.320080 -0.825025  1.255139  2.608229\n",
       "电子元件  -0.552516  0.112155  0.744475  1.567169\n",
       "房地产服务 -0.421037 -0.025753  0.586678  3.109428\n",
       "中药    -0.407737  0.044986  0.564092  1.523184\n",
       "贵金属   -0.371735  0.005601  1.102198  0.961012\n",
       "装修装饰  -0.200472 -0.145458  0.618859  3.702802\n",
       "多元金融  -0.135020 -0.879302  0.180284  4.169069\n",
       "教育    -0.127962 -0.518374  0.388277  7.301889\n",
       "通信服务  -0.115475 -0.179684  0.618240  2.029962"
      ]
     },
     "execution_count": 264,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col = '净资产收益率'\n",
    "industry_df.sort_values(by=col).head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 265,
   "id": "4b9252ba-2470-4e7f-b0f0-17eb2467d615",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>净资产收益率</th>\n",
       "      <th>利润率</th>\n",
       "      <th>资产周转率</th>\n",
       "      <th>权益乘数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>煤炭行业</th>\n",
       "      <td>0.156620</td>\n",
       "      <td>0.107619</td>\n",
       "      <td>0.742998</td>\n",
       "      <td>2.670721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>非金属材料</th>\n",
       "      <td>0.180088</td>\n",
       "      <td>0.391918</td>\n",
       "      <td>0.552968</td>\n",
       "      <td>1.650144</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>半导体</th>\n",
       "      <td>0.183254</td>\n",
       "      <td>0.197227</td>\n",
       "      <td>0.682239</td>\n",
       "      <td>1.525938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>医疗器械</th>\n",
       "      <td>0.197099</td>\n",
       "      <td>0.220366</td>\n",
       "      <td>0.600497</td>\n",
       "      <td>1.363706</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>化纤行业</th>\n",
       "      <td>0.216375</td>\n",
       "      <td>0.084503</td>\n",
       "      <td>0.734593</td>\n",
       "      <td>1.849676</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>能源金属</th>\n",
       "      <td>0.232329</td>\n",
       "      <td>0.223160</td>\n",
       "      <td>0.759508</td>\n",
       "      <td>1.828595</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>化学原料</th>\n",
       "      <td>0.251092</td>\n",
       "      <td>0.158898</td>\n",
       "      <td>0.867955</td>\n",
       "      <td>1.825754</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>电网设备</th>\n",
       "      <td>0.267241</td>\n",
       "      <td>0.040612</td>\n",
       "      <td>0.718300</td>\n",
       "      <td>2.116998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>化肥行业</th>\n",
       "      <td>0.280658</td>\n",
       "      <td>0.177985</td>\n",
       "      <td>0.873626</td>\n",
       "      <td>2.241918</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>塑料制品</th>\n",
       "      <td>0.369769</td>\n",
       "      <td>0.056128</td>\n",
       "      <td>0.796313</td>\n",
       "      <td>1.830124</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         净资产收益率       利润率     资产周转率      权益乘数\n",
       "行业名称                                         \n",
       "煤炭行业   0.156620  0.107619  0.742998  2.670721\n",
       "非金属材料  0.180088  0.391918  0.552968  1.650144\n",
       "半导体    0.183254  0.197227  0.682239  1.525938\n",
       "医疗器械   0.197099  0.220366  0.600497  1.363706\n",
       "化纤行业   0.216375  0.084503  0.734593  1.849676\n",
       "能源金属   0.232329  0.223160  0.759508  1.828595\n",
       "化学原料   0.251092  0.158898  0.867955  1.825754\n",
       "电网设备   0.267241  0.040612  0.718300  2.116998\n",
       "化肥行业   0.280658  0.177985  0.873626  2.241918\n",
       "塑料制品   0.369769  0.056128  0.796313  1.830124"
      ]
     },
     "execution_count": 265,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "industry_df.sort_values(by=col).tail(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 266,
   "id": "cd2376e3-f78f-40f0-b9da-f0aa347f0cc7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签\n",
    "plt.rcParams['axes.unicode_minus']=False #用来正常显示负号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 267,
   "id": "a34e5aca-0d38-42d2-893e-9e075e981c41",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='行业名称'>"
      ]
     },
     "execution_count": 267,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABKMAAAK/CAYAAAC1Pg7LAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAACIO0lEQVR4nOzdd5hkZZ238fsLMwwgwYQERXBFfRcTScWImFbFnNg1uwKLEbOoq6JrZM1rWDGuImJY0RVMYGB1MYE5gIJgQskIDGEG+L1/PKeYoulQnU6HuT/X1dfpOuep6h/UdJ9T3/OEVBWSJEmSJElSHzZY6AIkSZIkSZK0/jCMkiRJkiRJUm8MoyRJkiRJktQbwyhJkiRJkiT1xjBKkiRJkiRJvVmx0AUstBvf+Ma14447LnQZkiRJkiRJy8ZJJ510blVtNd6x9T6M2nHHHTnxxBMXugxJkiRJkqRlI8nvJzrmMD1JkiRJkiT1xjBKkiRJkiRJvTGMkiRJkiRJUm8MoyRJkiRJktQbwyhJkiRJk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OAb0fEFyrttgA+ABARD5dtEyNiGnCQpI+U/adHxDPA/w3lH2hmZmY2UMo6mGZmZmbWLST1AD0RMXsQx4wZTHszMzOzdnEwyszMzMzMzMzMauMC5mZmZmZmZmZmVhsHo8zMzMzMzMzMrDYORpmZmZmZmZmZWW0cjDIzMzMzMzMzs9r8P+U1KX5LNtqVAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "industry_df.sort_values(by=col).tail(10)['净资产收益率'].plot(kind='bar', figsize=(20,10), fontsize=25)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d395a37d-043a-48a7-903a-e45568509c0e",
   "metadata": {},
   "source": [
    "### 利润率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 268,
   "id": "ac4e066d-9063-4905-8ddc-09f5929633e9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>净资产收益率</th>\n",
       "      <th>利润率</th>\n",
       "      <th>资产周转率</th>\n",
       "      <th>权益乘数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>生物制品</th>\n",
       "      <td>0.114449</td>\n",
       "      <td>-951.398232</td>\n",
       "      <td>0.399385</td>\n",
       "      <td>1.771838</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>多元金融</th>\n",
       "      <td>-0.135020</td>\n",
       "      <td>-0.879302</td>\n",
       "      <td>0.180284</td>\n",
       "      <td>4.169069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>珠宝首饰</th>\n",
       "      <td>-1.320080</td>\n",
       "      <td>-0.825025</td>\n",
       "      <td>1.255139</td>\n",
       "      <td>2.608229</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>教育</th>\n",
       "      <td>-0.127962</td>\n",
       "      <td>-0.518374</td>\n",
       "      <td>0.388277</td>\n",
       "      <td>7.301889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>通信服务</th>\n",
       "      <td>-0.115475</td>\n",
       "      <td>-0.179684</td>\n",
       "      <td>0.618240</td>\n",
       "      <td>2.029962</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>旅游酒店</th>\n",
       "      <td>-0.010939</td>\n",
       "      <td>-0.174987</td>\n",
       "      <td>0.344102</td>\n",
       "      <td>2.642877</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>船舶制造</th>\n",
       "      <td>-0.034482</td>\n",
       "      <td>-0.172941</td>\n",
       "      <td>0.345275</td>\n",
       "      <td>1.894422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>装修装饰</th>\n",
       "      <td>-0.200472</td>\n",
       "      <td>-0.145458</td>\n",
       "      <td>0.618859</td>\n",
       "      <td>3.702802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>装修建材</th>\n",
       "      <td>-0.041266</td>\n",
       "      <td>-0.115341</td>\n",
       "      <td>0.771945</td>\n",
       "      <td>2.820240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>纺织服装</th>\n",
       "      <td>0.030583</td>\n",
       "      <td>-0.100895</td>\n",
       "      <td>0.696074</td>\n",
       "      <td>1.834591</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        净资产收益率         利润率     资产周转率      权益乘数\n",
       "行业名称                                          \n",
       "生物制品  0.114449 -951.398232  0.399385  1.771838\n",
       "多元金融 -0.135020   -0.879302  0.180284  4.169069\n",
       "珠宝首饰 -1.320080   -0.825025  1.255139  2.608229\n",
       "教育   -0.127962   -0.518374  0.388277  7.301889\n",
       "通信服务 -0.115475   -0.179684  0.618240  2.029962\n",
       "旅游酒店 -0.010939   -0.174987  0.344102  2.642877\n",
       "船舶制造 -0.034482   -0.172941  0.345275  1.894422\n",
       "装修装饰 -0.200472   -0.145458  0.618859  3.702802\n",
       "装修建材 -0.041266   -0.115341  0.771945  2.820240\n",
       "纺织服装  0.030583   -0.100895  0.696074  1.834591"
      ]
     },
     "execution_count": 268,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col = '利润率'\n",
    "industry_df.sort_values(by=col).head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 269,
   "id": "60892985-793f-4095-a8f5-7fb98931ad0f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>净资产收益率</th>\n",
       "      <th>利润率</th>\n",
       "      <th>资产周转率</th>\n",
       "      <th>权益乘数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>专业服务</th>\n",
       "      <td>0.106251</td>\n",
       "      <td>0.168984</td>\n",
       "      <td>0.546724</td>\n",
       "      <td>1.860796</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>航运港口</th>\n",
       "      <td>0.124894</td>\n",
       "      <td>0.174595</td>\n",
       "      <td>0.492365</td>\n",
       "      <td>1.810760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>化肥行业</th>\n",
       "      <td>0.280658</td>\n",
       "      <td>0.177985</td>\n",
       "      <td>0.873626</td>\n",
       "      <td>2.241918</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>半导体</th>\n",
       "      <td>0.183254</td>\n",
       "      <td>0.197227</td>\n",
       "      <td>0.682239</td>\n",
       "      <td>1.525938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>医疗器械</th>\n",
       "      <td>0.197099</td>\n",
       "      <td>0.220366</td>\n",
       "      <td>0.600497</td>\n",
       "      <td>1.363706</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>能源金属</th>\n",
       "      <td>0.232329</td>\n",
       "      <td>0.223160</td>\n",
       "      <td>0.759508</td>\n",
       "      <td>1.828595</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>证券</th>\n",
       "      <td>0.075200</td>\n",
       "      <td>0.261363</td>\n",
       "      <td>0.072527</td>\n",
       "      <td>4.165422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>银行</th>\n",
       "      <td>0.104388</td>\n",
       "      <td>0.325553</td>\n",
       "      <td>0.025543</td>\n",
       "      <td>12.528014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>铁路公路</th>\n",
       "      <td>0.080429</td>\n",
       "      <td>0.344942</td>\n",
       "      <td>0.239865</td>\n",
       "      <td>2.132222</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>非金属材料</th>\n",
       "      <td>0.180088</td>\n",
       "      <td>0.391918</td>\n",
       "      <td>0.552968</td>\n",
       "      <td>1.650144</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         净资产收益率       利润率     资产周转率       权益乘数\n",
       "行业名称                                          \n",
       "专业服务   0.106251  0.168984  0.546724   1.860796\n",
       "航运港口   0.124894  0.174595  0.492365   1.810760\n",
       "化肥行业   0.280658  0.177985  0.873626   2.241918\n",
       "半导体    0.183254  0.197227  0.682239   1.525938\n",
       "医疗器械   0.197099  0.220366  0.600497   1.363706\n",
       "能源金属   0.232329  0.223160  0.759508   1.828595\n",
       "证券     0.075200  0.261363  0.072527   4.165422\n",
       "银行     0.104388  0.325553  0.025543  12.528014\n",
       "铁路公路   0.080429  0.344942  0.239865   2.132222\n",
       "非金属材料  0.180088  0.391918  0.552968   1.650144"
      ]
     },
     "execution_count": 269,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "industry_df.sort_values(by=col).tail(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1e679389-8126-48bb-9267-35c4a9f48b83",
   "metadata": {},
   "source": [
    "### 权益乘数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 270,
   "id": "5bbaad18-46cc-4953-8d1e-f5538f136b90",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>净资产收益率</th>\n",
       "      <th>利润率</th>\n",
       "      <th>资产周转率</th>\n",
       "      <th>权益乘数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>贵金属</th>\n",
       "      <td>-0.371735</td>\n",
       "      <td>0.005601</td>\n",
       "      <td>1.102198</td>\n",
       "      <td>0.961012</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>仪器仪表</th>\n",
       "      <td>-0.114545</td>\n",
       "      <td>0.165114</td>\n",
       "      <td>0.516966</td>\n",
       "      <td>1.247954</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>医疗器械</th>\n",
       "      <td>0.197099</td>\n",
       "      <td>0.220366</td>\n",
       "      <td>0.600497</td>\n",
       "      <td>1.363706</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>美容护理</th>\n",
       "      <td>0.030784</td>\n",
       "      <td>0.112979</td>\n",
       "      <td>0.727185</td>\n",
       "      <td>1.493260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>中药</th>\n",
       "      <td>-0.407737</td>\n",
       "      <td>0.044986</td>\n",
       "      <td>0.564092</td>\n",
       "      <td>1.523184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>半导体</th>\n",
       "      <td>0.183254</td>\n",
       "      <td>0.197227</td>\n",
       "      <td>0.682239</td>\n",
       "      <td>1.525938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>电子化学品</th>\n",
       "      <td>0.057509</td>\n",
       "      <td>0.072361</td>\n",
       "      <td>0.578077</td>\n",
       "      <td>1.532468</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>软件开发</th>\n",
       "      <td>0.066255</td>\n",
       "      <td>0.081074</td>\n",
       "      <td>0.531899</td>\n",
       "      <td>1.565296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>电子元件</th>\n",
       "      <td>-0.552516</td>\n",
       "      <td>0.112155</td>\n",
       "      <td>0.744475</td>\n",
       "      <td>1.567169</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>非金属材料</th>\n",
       "      <td>0.180088</td>\n",
       "      <td>0.391918</td>\n",
       "      <td>0.552968</td>\n",
       "      <td>1.650144</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         净资产收益率       利润率     资产周转率      权益乘数\n",
       "行业名称                                         \n",
       "贵金属   -0.371735  0.005601  1.102198  0.961012\n",
       "仪器仪表  -0.114545  0.165114  0.516966  1.247954\n",
       "医疗器械   0.197099  0.220366  0.600497  1.363706\n",
       "美容护理   0.030784  0.112979  0.727185  1.493260\n",
       "中药    -0.407737  0.044986  0.564092  1.523184\n",
       "半导体    0.183254  0.197227  0.682239  1.525938\n",
       "电子化学品  0.057509  0.072361  0.578077  1.532468\n",
       "软件开发   0.066255  0.081074  0.531899  1.565296\n",
       "电子元件  -0.552516  0.112155  0.744475  1.567169\n",
       "非金属材料  0.180088  0.391918  0.552968  1.650144"
      ]
     },
     "execution_count": 270,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col = '权益乘数'\n",
    "industry_df.sort_values(by=col).head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 271,
   "id": "1df73ee7-f169-410e-8b85-01606862a12e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>净资产收益率</th>\n",
       "      <th>利润率</th>\n",
       "      <th>资产周转率</th>\n",
       "      <th>权益乘数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>行业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>电力行业</th>\n",
       "      <td>0.040503</td>\n",
       "      <td>0.088238</td>\n",
       "      <td>0.323739</td>\n",
       "      <td>4.022331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>证券</th>\n",
       "      <td>0.075200</td>\n",
       "      <td>0.261363</td>\n",
       "      <td>0.072527</td>\n",
       "      <td>4.165422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>多元金融</th>\n",
       "      <td>-0.135020</td>\n",
       "      <td>-0.879302</td>\n",
       "      <td>0.180284</td>\n",
       "      <td>4.169069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>汽车整车</th>\n",
       "      <td>0.058720</td>\n",
       "      <td>-0.071975</td>\n",
       "      <td>0.720720</td>\n",
       "      <td>4.582600</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公用事业</th>\n",
       "      <td>0.037058</td>\n",
       "      <td>0.144786</td>\n",
       "      <td>0.310716</td>\n",
       "      <td>4.610335</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>房地产开发</th>\n",
       "      <td>-0.019568</td>\n",
       "      <td>0.023839</td>\n",
       "      <td>0.202356</td>\n",
       "      <td>4.803887</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>采掘行业</th>\n",
       "      <td>-0.076073</td>\n",
       "      <td>-0.048306</td>\n",
       "      <td>0.511499</td>\n",
       "      <td>5.155492</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>教育</th>\n",
       "      <td>-0.127962</td>\n",
       "      <td>-0.518374</td>\n",
       "      <td>0.388277</td>\n",
       "      <td>7.301889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>保险</th>\n",
       "      <td>0.104164</td>\n",
       "      <td>0.060516</td>\n",
       "      <td>0.234120</td>\n",
       "      <td>8.318089</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>银行</th>\n",
       "      <td>0.104388</td>\n",
       "      <td>0.325553</td>\n",
       "      <td>0.025543</td>\n",
       "      <td>12.528014</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         净资产收益率       利润率     资产周转率       权益乘数\n",
       "行业名称                                          \n",
       "电力行业   0.040503  0.088238  0.323739   4.022331\n",
       "证券     0.075200  0.261363  0.072527   4.165422\n",
       "多元金融  -0.135020 -0.879302  0.180284   4.169069\n",
       "汽车整车   0.058720 -0.071975  0.720720   4.582600\n",
       "公用事业   0.037058  0.144786  0.310716   4.610335\n",
       "房地产开发 -0.019568  0.023839  0.202356   4.803887\n",
       "采掘行业  -0.076073 -0.048306  0.511499   5.155492\n",
       "教育    -0.127962 -0.518374  0.388277   7.301889\n",
       "保险     0.104164  0.060516  0.234120   8.318089\n",
       "银行     0.104388  0.325553  0.025543  12.528014"
      ]
     },
     "execution_count": 271,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "industry_df.sort_values(by=col).tail(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bc5e3043-5a1a-43b7-ad9f-75acf4b8d3a6",
   "metadata": {},
   "source": [
    "# 爬虫的使用的注意问题"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9a6593e2-43d9-491c-81e5-e6f03d209db5",
   "metadata": {},
   "source": [
    "## 不要乱爬"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "66f32520-c25e-4a89-b1cf-3b4d355b2dbd",
   "metadata": {},
   "source": [
    "### 网页要求"
   ]
  },
  {
   "cell_type": "raw",
   "id": "6c8aa851-55fd-47ed-8c0a-44c9cbc5b2c3",
   "metadata": {},
   "source": [
    "https://www.baidu.com/robots.txt"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6d803ec5-8d37-4edc-bc7a-30719f00baba",
   "metadata": {},
   "source": [
    "### 法律要求"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d950be45-b9e9-4f23-afbd-a7785b86504e",
   "metadata": {},
   "source": [
    "https://github.com/HiddenStrawberry/Crawler_Illegal_Cases_In_China\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "740dfc00-ce7c-44f3-9a28-4bf3ea4d54b2",
   "metadata": {},
   "source": [
    "《关于办理非法利用信息网络、帮助信息网络犯罪活动等刑事案件适用法律若干问题的解释》（法释〔2019〕15号）  \n",
    "第四条拒不履行信息网络安全管理义务，致使用户信息泄露，具有下列情形之一的，应当认定为刑法第二百八十六条之一第一款第二项规定的“造成严重后果”：\n",
    "- （一）致使泄露行踪轨迹信息、通信内容、征信信息、财产信息五百条以上的；\n",
    "- （二）致使泄露住宿信息、通信记录、健康生理信息、交易信息等其他可能影响人身、财产安全的用户信息五千条以上的；\n",
    "- （三）致使泄露第一项、第二项规定以外的用户信息五万条以上的；"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eb4d652b-2ca8-42c1-ba1f-9e5f7b3e21f0",
   "metadata": {},
   "source": [
    "## 不要给服务器增加压力"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6657cce0-1f96-46c4-87af-e88065e61003",
   "metadata": {},
   "source": [
    "网站开发者希望：更多人看，而不是一个人看更多"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 272,
   "id": "7cc8a1af-0d58-4eb4-b260-76ec8c4937f9",
   "metadata": {},
   "outputs": [],
   "source": [
    "total_df.to_csv('2022-11-17 导出.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "feee6539-cab3-466c-89fe-0e706726398f",
   "metadata": {},
   "source": [
    "## 爬虫的进阶"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c3b1bbc8-27c1-407b-b795-229e0e1d94f9",
   "metadata": {},
   "source": [
    "### 维护爬虫"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6b5e8b76-fc6c-40ec-9ec6-d7bb0e5e2209",
   "metadata": {},
   "source": [
    "网站可能更新，导致结构/接口变化"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "99e8d68d-77e4-4153-8393-d4af84fdb902",
   "metadata": {},
   "source": [
    "### IP池、cookie池"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cd6ce0e0-e55d-4dd5-98e6-6343171d7f28",
   "metadata": {},
   "source": [
    "防止服务器限制"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "742137a5-c521-42c6-9b57-a985865053c1",
   "metadata": {},
   "source": [
    "## 崔庆才推荐"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "toc-autonumbering": true
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
